From: Jim Jagielski Date: Thu, 30 Sep 2004 17:12:42 +0000 (+0000) Subject: Add in most-likely last patch before 1.3.32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74d85c28ed82e01f1b08afdfa72e618a1076ac48;p=thirdparty%2Fapache%2Fhttpd.git Add in most-likely last patch before 1.3.32 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@105355 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index b84958ccc3d..683e4c9e8ad 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 1.3 STATUS: -*-text-*- - Last modified at [$Date: 2004/09/22 13:01:17 $] + Last modified at [$Date: 2004/09/30 17:12:41 $] Release: @@ -50,11 +50,6 @@ RELEASE SHOWSTOPPERS: PROPOSED PATCHES FOR THIS RELEASE: - *) 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 - +1: nd, trawick, jim - *) mod_rewrite:Fix query string handling for proxied URLs. PR 14518. modules/mappers/mod_rewrite.c: r1.259 (2.x patch - need 1.3 version) +1: nd diff --git a/src/CHANGES b/src/CHANGES index 598b676b662..ac1d5c8f5ad 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 1.3.32 + *) mod_rewrite: Fix 0 bytes write into random memory position. + PR 31036. [André Malo] + *) mod_digest: Fix nonce string calculation since 1.3.31 which would force re-authentication for every connection if AuthDigestRealmSeed was not configured. PR 30920. [Joe Orton] diff --git a/src/modules/standard/mod_rewrite.c b/src/modules/standard/mod_rewrite.c index ccace1e873d..7e837987bed 100644 --- a/src/modules/standard/mod_rewrite.c +++ b/src/modules/standard/mod_rewrite.c @@ -3034,22 +3034,27 @@ static char *lookup_map_dbmfile(request_rec *r, char *file, char *key) DBM *dbmfp = NULL; datum dbmkey; datum dbmval; - char *value = NULL; - char buf[MAX_STRING_LEN]; + char *value; + + if (!(dbmfp = dbm_open(file, O_RDONLY, 0666))) { + return NULL; + } dbmkey.dptr = key; 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 < sizeof(buf)-1 ? - dbmval.dsize : sizeof(buf)-1 ); - buf[dbmval.dsize] = '\0'; - value = ap_pstrdup(r->pool, buf); - } - dbm_close(dbmfp); + + dbmval = dbm_fetch(dbmfp, dbmkey); + if (dbmval.dptr) { + value = ap_palloc(r->pool, dbmval.dsize + 1); + memcpy(value, dbmval.dptr, dbmval.dsize); + value[dbmval.dsize] = '\0'; + } + else { + value = NULL; } + + dbm_close(dbmfp); + return value; } #endif