From 73bfea9d4c0cb6283db870e692f41eb8bb71876c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Jun 2002 15:14:33 +0000 Subject: [PATCH] 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 --- server/mpm/winnt/service.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 */ -- 2.50.1