httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@hyperreal.org
Subject cvs commit: apache-1.3/src/modules/standard mod_rewrite.c
Date Wed, 02 Dec 1998 08:24:40 GMT
rse         98/12/02 00:24:40

  Modified:    src      CHANGES
               src/modules/standard mod_rewrite.c
  Log:
  Fixed possible (but harmless in practice) bug in the DBM lookup
  procedure of mod_rewrite: very long keys were truncated.
  
  Revision  Changes    Path
  1.1156    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1155
  retrieving revision 1.1156
  diff -u -r1.1155 -r1.1156
  --- CHANGES	1998/12/02 06:12:09	1.1155
  +++ CHANGES	1998/12/02 08:24:35	1.1156
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.4
   
  +  *) Fixed possible (but harmless in practice) bug in the DBM lookup
  +     procedure of mod_rewrite: very long keys were truncated.
  +     [Ralf S. Engelschall]
  +
     *) There is no longer a _default_ path layout for APACI configure.
        This means the user _HAS_ to specifiy a path layout _explicitly_.
   
  
  
  
  1.132     +4 -3      apache-1.3/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.131
  retrieving revision 1.132
  diff -u -r1.131 -r1.132
  --- mod_rewrite.c	1998/10/28 15:01:18	1.131
  +++ mod_rewrite.c	1998/12/02 08:24:39	1.132
  @@ -2877,12 +2877,13 @@
       char buf[MAX_STRING_LEN];
   
       dbmkey.dptr  = key;
  -    dbmkey.dsize = (strlen(key) < sizeof(buf) - 1 ?
  -                    strlen(key) : sizeof(buf)-1);
  +    dbmkey.dsize = strlen(key);
       if ((dbmfp = dbm_open(file, O_RDONLY, 0666)) != NULL) {
           dbmval = dbm_fetch(dbmfp, dbmkey);
           if (dbmval.dptr != NULL) {
  -            memcpy(buf, dbmval.dptr, dbmval.dsize);
  +            memcpy(buf, dbmval.dptr, 
  +                   dbmval.dsize < sizeof(buf)-1 ? 
  +                   dbmval.dsize : sizeof(buf)-1  );
               buf[dbmval.dsize] = '\0';
               value = ap_pstrdup(r->pool, buf);
           }
  
  
  

Mime
View raw message