From: Ilia Alshanetsky Date: Mon, 19 Feb 2007 23:52:13 +0000 (+0000) Subject: Fixed strlcat() usage. X-Git-Tag: php-5.2.2RC1~358 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ae588dfb16eeaf0fe868f5048f669a3a5bc247a;p=php Fixed strlcat() usage. # Thanks Andi --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 830dee4ccf..4b92e55df2 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1636,7 +1636,8 @@ consult the installation file that came with this distribution, or visit \n\ } } - s = malloc(++len + 1); + len += 2; + s = malloc(len); *s = '\0'; /* we are pretending it came from the environment */ for (i = php_optind; i < argc; i++) { strlcat(s, argv[i], len);