From: Florian Forster Date: Mon, 12 Jul 2010 07:56:02 +0000 (+0200) Subject: src/utils_cgi.c: uri_unescape_copy: Fix a potential buffer overflow. X-Git-Tag: v4.0.0~111 X-Git-Url: https://git.octo.it/?p=collection4.git;a=commitdiff_plain;h=60bc35adce4421df6d058c4cc20e9b66ee9ec322 src/utils_cgi.c: uri_unescape_copy: Fix a potential buffer overflow. --- diff --git a/src/utils_cgi.c b/src/utils_cgi.c index f4abec2..7c01bd9 100644 --- a/src/utils_cgi.c +++ b/src/utils_cgi.c @@ -104,6 +104,7 @@ static char *uri_unescape_copy (char *dest, const char *src, size_t n) /* {{{ */ *dest_ptr = *src_ptr; } + n--; src_ptr++; dest_ptr++; *dest_ptr = 0; @@ -111,7 +112,7 @@ static char *uri_unescape_copy (char *dest, const char *src, size_t n) /* {{{ */ assert (*dest_ptr == 0); return (dest); -} /* }}} char *uri_unescape */ +} /* }}} char *uri_unescape_copy */ static char *uri_unescape (const char *string) /* {{{ */ {