You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rs...@hyperreal.org on 1998/06/03 14:12:13 UTC

cvs commit: apache-1.3/src/modules/standard mod_rewrite.c

rse         98/06/03 05:12:12

  Modified:    src      CHANGES
               src/modules/standard mod_rewrite.c
  Log:
  Fix recently introduced Win32 child spawning code in mod_rewrite.c which was
  broken because of invalid ap_pstrcat() -> strcat() transformation.  I'm a
  little bit confused: Seems like no one has actually compiled Apache with all
  modules under Win32 just before Jim rolled the 1.3.0 tarball. Because else
  someone had received a compile error. Hmmm... I knew why I hates to put code
  into mod_rewrite I couldn't test myself... :-(
  
  Revision  Changes    Path
  1.882     +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.881
  retrieving revision 1.882
  diff -u -r1.881 -r1.882
  --- CHANGES	1998/06/02 12:50:44	1.881
  +++ CHANGES	1998/06/03 12:12:10	1.882
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.1
   
  +  *) Fix recently introduced Win32 child spawning code in mod_rewrite.c which
  +     was broken because of invalid ap_pstrcat() -> strcat() transformation.
  +     [Ralf S. Engelschall]
  +
     *) Proxy Cache Fixes: account for directory sizes, fork off garbage collection
        to continue in background, use predefined types (off_t, size_t, time_t),
        log the current cache usage percentage at LogLevel debug
  
  
  
  1.114     +2 -2      apache-1.3/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- mod_rewrite.c	1998/05/29 09:19:41	1.113
  +++ mod_rewrite.c	1998/06/03 12:12:11	1.114
  @@ -3190,11 +3190,11 @@
   #if defined(WIN32)
       /* MS Windows */
       {
  -        char *pCommand;
  +        char pCommand[MAX_STRING_LEN];
           STARTUPINFO si;
           PROCESS_INFORMATION pi;
   
  -        pCommand = strcat(SHELL_PATH, " /C ", cmd, NULL);
  +        sprintf(pCommand, "%s /C %s", SHELL_PATH, cmd);
   
           memset(&si, 0, sizeof(si));
           memset(&pi, 0, sizeof(pi));
  
  
  

Re: cvs commit: apache-1.3/src/modules/standard mod_rewrite.c

Posted by Marc Slemko <ma...@worldgate.com>.
On 3 Jun 1998 rse@hyperreal.org wrote:

> rse         98/06/03 05:12:12
> 
>   Modified:    src      CHANGES
>                src/modules/standard mod_rewrite.c
>   Log:
>   Fix recently introduced Win32 child spawning code in mod_rewrite.c which was
>   broken because of invalid ap_pstrcat() -> strcat() transformation.  I'm a
>   little bit confused: Seems like no one has actually compiled Apache with all
>   modules under Win32 just before Jim rolled the 1.3.0 tarball. Because else
>   someone had received a compile error. Hmmm... I knew why I hates to put code
>   into mod_rewrite I couldn't test myself... :-(

Why is it using sprintf?

No.  Code.  Should.  Use.  sprintf.  Almost.

We have an ap_snprintf.  Use it.  I don't care if it isn't necessary or
you think it isn't necessary or it may not be necessary or you hope it
isn't necessary.  Always unless you shouldn't. And I see no reason why you
shouldn't here. 


>   +++ mod_rewrite.c	1998/06/03 12:12:11	1.114
>   @@ -3190,11 +3190,11 @@
>    #if defined(WIN32)
>        /* MS Windows */
>        {
>   -        char *pCommand;
>   +        char pCommand[MAX_STRING_LEN];
>            STARTUPINFO si;
>            PROCESS_INFORMATION pi;
>    
>   -        pCommand = strcat(SHELL_PATH, " /C ", cmd, NULL);
>   +        sprintf(pCommand, "%s /C %s", SHELL_PATH, cmd);
>    
>            memset(&si, 0, sizeof(si));
>            memset(&pi, 0, sizeof(pi));
>   
>   
>   
> 



Re: cvs commit: apache-1.3/src/modules/standard mod_rewrite.c

Posted by Marc Slemko <ma...@worldgate.com>.
On 3 Jun 1998 rse@hyperreal.org wrote:

> rse         98/06/03 05:12:12
> 
>   Modified:    src      CHANGES
>                src/modules/standard mod_rewrite.c
>   Log:
>   Fix recently introduced Win32 child spawning code in mod_rewrite.c which was
>   broken because of invalid ap_pstrcat() -> strcat() transformation.  I'm a
>   little bit confused: Seems like no one has actually compiled Apache with all
>   modules under Win32 just before Jim rolled the 1.3.0 tarball. Because else
>   someone had received a compile error. Hmmm... I knew why I hates to put code
>   into mod_rewrite I couldn't test myself... :-(

Why is it using sprintf?

No.  Code.  Should.  Use.  sprintf.  Almost.

We have an ap_snprintf.  Use it.  I don't care if it isn't necessary or
you think it isn't necessary or it may not be necessary or you hope it
isn't necessary.  Always unless you shouldn't. And I see no reason why you
shouldn't here. 


>   +++ mod_rewrite.c	1998/06/03 12:12:11	1.114
>   @@ -3190,11 +3190,11 @@
>    #if defined(WIN32)
>        /* MS Windows */
>        {
>   -        char *pCommand;
>   +        char pCommand[MAX_STRING_LEN];
>            STARTUPINFO si;
>            PROCESS_INFORMATION pi;
>    
>   -        pCommand = strcat(SHELL_PATH, " /C ", cmd, NULL);
>   +        sprintf(pCommand, "%s /C %s", SHELL_PATH, cmd);
>    
>            memset(&si, 0, sizeof(si));
>            memset(&pi, 0, sizeof(pi));
>   
>   
>   
>