glib2/backport-glocalfileinfo-Correct-an-off-by-one-error-when-unescaping-hex.patch
shirely16 a3d31ddf3c synchronous community patch
(cherry picked from commit 5fb95aa15490a21b390e53a88c1b8b052971e504)
2021-05-21 15:56:45 +08:00

41 lines
1.1 KiB
Diff

From 63b329fb818358eaf6688f4f78779ef3ee6cfb99 Mon Sep 17 00:00:00 2001
From: Sergio Gelato <sergio.gelato@astro.su.se>
Date: Wed, 8 Jul 2020 12:45:43 +0100
Subject: [PATCH 0715/1095] glocalfileinfo: Correct an off-by-one error when
unescaping hex
Correct an off-by-one error in hex_unescape_string()'s computation of
the output string length.
(Turned into a git-format patch by Philip Withnall. Original patch
submitted on the Debian bug tracker, bug#962912.)
reason:Correct an off-by-one error when unescaping hex
Conflict:NA
Reference:https://github.com/GNOME/glib/commit/63b329fb818358eaf6688f4f78779ef3ee6cfb99
---
gio/glocalfileinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index 6cac187..4ca1ce6 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -394,10 +394,10 @@ hex_unescape_string (const char *str,
else
*p++ = str[i];
}
- *p++ = 0;
-
if (out_len)
*out_len = p - unescaped_str;
+ *p++ = 0;
+
*free_return = TRUE;
return unescaped_str;
}
--
1.8.3.1