be used when the key was not found in the dbm.
apr_dbm_fetch() returns APR_SUCCESS as long as there was no I/O
error. mod_rewrite needed to look further to see if the key
was actually found.
PR 13204
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97106
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.44
+ *) Fix a bug with dbm rewrite maps which caused the wrong value to
+ be used when the key was not found in the dbm. PR 13204
+ [Jeff Trawick]
+
*) Fix a problem with streaming script output and mod_cgid.
[Jeff Trawick]
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) {
+ if (rv == APR_SUCCESS && dbmval.dptr) {
memcpy(buf, dbmval.dptr,
dbmval.dsize < sizeof(buf)-1 ?
dbmval.dsize : sizeof(buf)-1 );