]> granicus.if.org Git - php/commitdiff
MFB
authorAntony Dovgal <tony2001@php.net>
Tue, 20 Feb 2007 09:09:47 +0000 (09:09 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 20 Feb 2007 09:09:47 +0000 (09:09 +0000)
sapi/cgi/cgi_main.c

index 9862f7895fa3364bc9185c49bd3c640f6d86c096..4805f2ca482a5cda8eefe1b06f9106c82411b262 100644 (file)
@@ -1569,7 +1569,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);