httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server config.c
Date Wed, 26 Dec 2001 09:52:53 GMT
brianp      01/12/26 01:52:53

  Modified:    server   config.c
  Log:
  Removed a large (8KB) buffer from the stack in ap_invoke_handler()
  
  Revision  Changes    Path
  1.142     +4 -5      httpd-2.0/server/config.c
  
  Index: config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/config.c,v
  retrieving revision 1.141
  retrieving revision 1.142
  diff -u -r1.141 -r1.142
  --- config.c	2001/12/14 03:30:23	1.141
  +++ config.c	2001/12/26 09:52:53	1.142
  @@ -328,9 +328,7 @@
   {
       const char *handler;
       const char *p;
  -    char *p2;
       int result;
  -    char hbuf[MAX_STRING_LEN];
       const char *old_handler = r->handler;
   
       /*
  @@ -346,9 +344,10 @@
       if (!r->handler) {
           handler = r->content_type ? r->content_type : ap_default_type(r);
           if ((p=ap_strchr_c(handler, ';')) != NULL) {
  -	    apr_cpystrn(hbuf, handler, sizeof hbuf);
  -	    p2 = hbuf+(handler-p);
  -	    handler = hbuf;
  +            char *new_handler = (char *)apr_pmemdup(r->pool, handler,
  +                                                    p - handler + 1);
  +            char *p2 = new_handler + (p - handler);
  +            handler = new_handler;
   	    /* MIME type arguments */
               while (p2 > handler && p2[-1] == ' ')
   	        --p2;		/* strip trailing spaces */
  
  
  

Mime
View raw message