From 206e02d428e9e8b05ce455a7c09c96f566a88aef Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 27 Apr 2013 17:44:36 +0000 Subject: [PATCH] mod_dav: Do not fail PROPPATCH when prop namespace is not known. PR 52559 Submitted by: Diego Santa Cruz Tested by William Lewis git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476644 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/dav/fs/dbm.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c5f27bcb6f..d6cf692147 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_dav: Do not fail PROPPATCH when prop namespace is not known. + PR 52559 [Diego Santa Cruz ] + *) mod_dav: When a PROPPATCH attempts to remove a non-existent dead property on a resource for which there is no dead property in the same namespace httpd segfaults. PR 52559 [Diego Santa Cruz diff --git a/modules/dav/fs/dbm.c b/modules/dav/fs/dbm.c index 9089373991..821168e887 100644 --- a/modules/dav/fs/dbm.c +++ b/modules/dav/fs/dbm.c @@ -191,7 +191,15 @@ void dav_dbm_close(dav_db *db) dav_error * dav_dbm_fetch(dav_db *db, apr_datum_t key, apr_datum_t *pvalue) { - apr_status_t status = apr_dbm_fetch(db->file, key, pvalue); + apr_status_t status; + + if (!key.dptr) { + /* no key could be created (namespace not known) => no value */ + memset(pvalue, 0, sizeof(*pvalue)); + status = APR_SUCCESS; + } else { + status = apr_dbm_fetch(db->file, key, pvalue); + } return dav_fs_dbm_error(db, NULL, status); } -- 2.40.0