httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Wed, 13 Oct 2004 16:51:39 GMT
minfrin     2004/10/13 09:51:39

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               modules/mappers Tag: APACHE_2_0_BRANCH mod_rewrite.c
  Log:
  mod_rewrite: Fix 0 bytes write into random memory position.
  PR:	31036
  Submitted by:	nd
  Reviewed by:	nd, trawick, jerenkrantz, jim
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.370 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.369
  retrieving revision 1.988.2.370
  diff -u -r1.988.2.369 -r1.988.2.370
  --- CHANGES	13 Oct 2004 16:40:52 -0000	1.988.2.369
  +++ CHANGES	13 Oct 2004 16:51:36 -0000	1.988.2.370
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.53
   
  +  *) mod_rewrite: Fix 0 bytes write into random memory position.
  +     PR 31036. [André Malo]
  +
     *) mod_disk_cache: Do not store aborted content.  PR 21492.
        [Rüiger Plü <r.pluem t-online.de>]
   
  
  
  
  1.751.2.1116 +1 -2      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.1115
  retrieving revision 1.751.2.1116
  diff -u -r1.751.2.1115 -r1.751.2.1116
  --- STATUS	13 Oct 2004 16:40:54 -0000	1.751.2.1115
  +++ STATUS	13 Oct 2004 16:51:37 -0000	1.751.2.1116
  @@ -129,7 +129,6 @@
       *) mod_rewrite: Fix 0 bytes write into random memory position. PR 31036.
          (2.0 + 1.3)
            http://www.apache.org/~nd/dbmmap_1.3.patch
  -         http://www.apache.org/~nd/dbmmap_2.0.patch
          +1: nd, trawick, jerenkrantz, jim
   
       *) mod_rewrite:Fix query string handling for proxied URLs. PR 14518.
  
  
  
  No                   revision
  No                   revision
  1.135.2.31 +15 -15    httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.135.2.30
  retrieving revision 1.135.2.31
  diff -u -r1.135.2.30 -r1.135.2.31
  --- mod_rewrite.c	27 Aug 2004 19:23:26 -0000	1.135.2.30
  +++ mod_rewrite.c	13 Oct 2004 16:51:38 -0000	1.135.2.31
  @@ -3200,25 +3200,25 @@
       apr_dbm_t *dbmfp = NULL;
       apr_datum_t dbmkey;
       apr_datum_t dbmval;
  -    char *value = NULL;
  -    char buf[MAX_STRING_LEN];
  -    apr_status_t rv;
  +    char *value;
  +
  +    if (apr_dbm_open_ex(&dbmfp, dbmtype, file, APR_DBM_READONLY, APR_OS_DEFAULT, 
  +                        r->pool) != APR_SUCCESS) {
  +        return NULL;
  +    }
   
       dbmkey.dptr  = key;
       dbmkey.dsize = strlen(key);
  -    if ((rv = apr_dbm_open_ex(&dbmfp, dbmtype, file, APR_DBM_READONLY,
  -                              0 /* irrelevant when reading */,
  -                              r->pool)) == APR_SUCCESS) {
  -        rv = apr_dbm_fetch(dbmfp, dbmkey, &dbmval);
  -        if (rv == APR_SUCCESS && dbmval.dptr) {
  -            memcpy(buf, dbmval.dptr,
  -                   dbmval.dsize < sizeof(buf)-1 ?
  -                   dbmval.dsize : sizeof(buf)-1  );
  -            buf[dbmval.dsize] = '\0';
  -            value = apr_pstrdup(r->pool, buf);
  -        }
  -        apr_dbm_close(dbmfp);
  +
  +    if (apr_dbm_fetch(dbmfp, dbmkey, &dbmval) == APR_SUCCESS && dbmval.dptr)
{
  +        value = apr_pstrmemdup(r->pool, dbmval.dptr, dbmval.dsize);
       }
  +    else {
  +        value = NULL;
  +    }
  +
  +    apr_dbm_close(dbmfp);
  +
       return value;
   }
   
  
  
  

Mime
View raw message