From 9ae588dfb16eeaf0fe868f5048f669a3a5bc247a Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 19 Feb 2007 23:52:13 +0000 Subject: [PATCH] Fixed strlcat() usage. # Thanks Andi --- sapi/cgi/cgi_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.50.1