gregames    2002/10/31 11:39:05

  Modified:    specweb99/specweb99-2.0 mod_specweb99.c
  Log:
  back out part of rev 1.13.  The CAD GET buffer still needs to be null 
terminated
  to stop the strstr.
  
  I wasn't seeing seg faults, but oprofile showed the cycles in strstr jumped up
  noticeably.
  
  Revision  Changes    Path
  1.16      +5 -2      httpd-test/specweb99/specweb99-2.0/mod_specweb99.c
  
  Index: mod_specweb99.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/specweb99/specweb99-2.0/mod_specweb99.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- mod_specweb99.c   30 Oct 2002 21:33:45 -0000      1.15
  +++ mod_specweb99.c   31 Oct 2002 19:39:04 -0000      1.16
  @@ -836,7 +836,7 @@
        return NULL;
   
       len = s.size;
  -    buf = apr_palloc(r->pool, len);
  +    buf = apr_palloc(r->pool, len + 1);
   
       /* On systems with mmap, it might be faster to mmap the file, scan the 
mmap,
        * then send down mmap buckets for the unaltered pieces of the the file.
  @@ -846,6 +846,9 @@
        || (l != len))
        return NULL;            /* Error on read */
   
  +    buf[len] = '\0';            /* Null terminate it so the strstr will
  +                                 * halt
  +                                 */
       index = buf;
       /*
        * It says in the run rules that we are to scan until the end of the
  
  
  

Reply via email to