From 60bc35adce4421df6d058c4cc20e9b66ee9ec322 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 12 Jul 2010 09:56:02 +0200 Subject: [PATCH] src/utils_cgi.c: uri_unescape_copy: Fix a potential buffer overflow. --- src/utils_cgi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) /* {{{ */ { -- 2.11.0