From: Henrik Nordstrom Date: Thu, 5 Nov 2009 08:06:19 +0000 (+0100) Subject: Another regression in %nn cleanup X-Git-Tag: SQUID_3_2_0_1~614 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55b5914ba0c8eaa96febf9035b605778f082cd35;p=thirdparty%2Fsquid.git Another regression in %nn cleanup --- diff --git a/lib/rfc1738.c b/lib/rfc1738.c index a769e60eb6..bba0a5d6a7 100644 --- a/lib/rfc1738.c +++ b/lib/rfc1738.c @@ -202,14 +202,18 @@ rfc1738_unescape(char *s) } else { /* decode */ char v1, v2; + int x; v1 = fromhex(s[j + 1]); if (v1 < 0) continue; /* non-hex or \0 */ v2 = fromhex(s[j + 2]); if (v2 < 0) continue; /* non-hex or \0 */ - s[i] = v1 << 4 | v2; - j += 2; + x = v1 << 4 | v2; + if (x > 0 && x <= 255) { + s[i] = x; + j += 2; + } } } s[i] = '\0';