httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/winnt service.c
Date Wed, 05 Jun 2002 15:14:33 GMT
wrowe       2002/06/05 08:14:33

  Modified:    server/mpm/winnt service.c
  Log:
    Potential fixes.  Patch up the fact that users often expect argv[]s
    to be NULL terminated, even though argc should clearly limit the array.
  
  Revision  Changes    Path
  1.52      +3 -2      httpd-2.0/server/mpm/winnt/service.c
  
  Index: service.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/service.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- service.c	17 May 2002 11:11:39 -0000	1.51
  +++ service.c	5 Jun 2002 15:14:33 -0000	1.52
  @@ -1058,11 +1058,12 @@
           }
           
           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 */
  
  
  

Mime
View raw message