]> granicus.if.org Git - php/commitdiff
Fixed strlcat() usage.
authorIlia Alshanetsky <iliaa@php.net>
Mon, 19 Feb 2007 23:52:13 +0000 (23:52 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 19 Feb 2007 23:52:13 +0000 (23:52 +0000)
# Thanks Andi

sapi/cgi/cgi_main.c

index 830dee4ccf7507be4e360f290f0be0bbe0d038ef..4b92e55df240d39c38fc79df1425c038954da1bb 100644 (file)
@@ -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);