From 7d6ed83cb1064e3e027959318cc2f2c63c21c047 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 22 Mar 2010 19:50:31 +0200 Subject: [PATCH] core cleanup: fix thinko in previous commit --- src/core/sipmsg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/sipmsg.c b/src/core/sipmsg.c index f287de83..c510855a 100644 --- a/src/core/sipmsg.c +++ b/src/core/sipmsg.c @@ -568,12 +568,13 @@ gchar *sipmsg_uri_unescape(const gchar *string) unescaped = g_malloc(len + 1); while (len-- > 0) { gchar c = *string++; - if (c == '%') { + if ((len >= 2) && (c == '%')) { char hex[3]; strncpy(hex, string, 2); hex[2] = '\0'; c = strtol(hex, NULL, 16); string += 2; + len -= 2; } unescaped[i++] = c; } -- 2.11.4.GIT