Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 14449 invoked by uid 6000); 8 Jun 1998 05:30:41 -0000 Received: (qmail 14383 invoked by alias); 8 Jun 1998 05:30:39 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 14381 invoked from network); 8 Jun 1998 05:30:38 -0000 Received: from valis.worldgate.com (marcs@198.161.84.2) by taz.hyperreal.org with SMTP; 8 Jun 1998 05:30:38 -0000 Received: from localhost (marcs@localhost) by valis.worldgate.com (8.8.7/8.8.7) with SMTP id XAA02664; Sun, 7 Jun 1998 23:30:36 -0600 (MDT) Date: Sun, 7 Jun 1998 23:30:35 -0600 (MDT) From: Marc Slemko To: new-httpd@apache.org cc: apache-1.3-cvs@hyperreal.org Subject: Re: cvs commit: apache-1.3/src/modules/standard mod_rewrite.c In-Reply-To: <19980603121213.3447.qmail@hyperreal.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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)); > > > >