]> granicus.if.org Git - apache/commitdiff
mod_dav: Do not fail PROPPATCH when prop namespace is not known. PR 52559
authorGraham Leggett <minfrin@apache.org>
Sat, 27 Apr 2013 17:44:36 +0000 (17:44 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 27 Apr 2013 17:44:36 +0000 (17:44 +0000)
Submitted by: Diego Santa Cruz <diego.santaCruz spinetix.com>
Tested by William Lewis <wiml omnigroup com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476644 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/dav/fs/dbm.c

diff --git a/CHANGES b/CHANGES
index c5f27bcb6fb6606bc56dfdc827cdb6b084133b57..d6cf692147559bbbc9e2e1769f3762b32863d151 100644 (file)
--- 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 <diego.santaCruz spinetix.com>]
+
   *) 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
index 9089373991a924f2ddbecd79f6f7599f4d153eba..821168e887e272a0e035ec425563a230f1c43651 100644 (file)
@@ -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);
 }