From: William A. Rowe Jr Date: Wed, 5 Jun 2002 15:14:33 +0000 (+0000) Subject: Potential fixes. Patch up the fact that users often expect argv[]s X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73bfea9d4c0cb6283db870e692f41eb8bb71876c;p=apache Potential fixes. Patch up the fact that users often expect argv[]s to be NULL terminated, even though argc should clearly limit the array. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95525 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/service.c b/server/mpm/winnt/service.c index d6f3b60073..93cfe5da29 100644 --- a/server/mpm/winnt/service.c +++ b/server/mpm/winnt/service.c @@ -1058,11 +1058,12 @@ apr_status_t mpm_service_start(apr_pool_t *ptemp, int argc, } argc += 1; - start_argv = malloc(argc * sizeof(const char **)); + start_argv = malloc((argc + 1) * sizeof(const char **)); start_argv[0] = mpm_service_name; if (argc > 1) memcpy(start_argv + 1, argv, (argc - 1) * sizeof(const char **)); - + start_argv[argc] = NULL; + rv = APR_EINIT; if (StartService(schService, argc, start_argv) && signal_service_transition(schService, 0, /* test only */