]> granicus.if.org Git - apache/commitdiff
mod_dav: Do not segfault on PROPFIND with a zero length DBM. PR 52559
authorGraham Leggett <minfrin@apache.org>
Sat, 27 Apr 2013 17:52:03 +0000 (17:52 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 27 Apr 2013 17:52:03 +0000 (17:52 +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@1476645 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/dav/main/props.c

diff --git a/CHANGES b/CHANGES
index d6cf692147559bbbc9e2e1769f3762b32863d151..5d0b53c88f460ea4e6fc26002b74b6ce06946534 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_dav: Do not segfault on PROPFIND with a zero length DBM.
+     PR 52559 [Diego Santa Cruz <diego.santaCruz spinetix.com>]
+
   *) mod_dav: Do not fail PROPPATCH when prop namespace is not known.
      PR 52559 [Diego Santa Cruz <diego.santaCruz spinetix.com>]
 
index 19c7b11aef1b400892804076631f6201c4336da6..507ba52d8b6929ce00e77d498c87e4363e254ae0 100644 (file)
@@ -594,13 +594,14 @@ DAV_DECLARE(dav_get_props_result) dav_get_allprops(dav_propdb *propdb,
         if (propdb->db != NULL) {
             dav_xmlns_info *xi = dav_xmlns_create(propdb->p);
             dav_prop_name name;
+            dav_error *err;
 
             /* define (up front) any namespaces the db might need */
             (void) (*db_hooks->define_namespaces)(propdb->db, xi);
 
             /* get the first property name, beginning the scan */
-            (void) (*db_hooks->first_name)(propdb->db, &name);
-            while (name.ns != NULL) {
+            err = (*db_hooks->first_name)(propdb->db, &name);
+            while (!err && name.ns) {
 
                 /*
                 ** We also look for <DAV:getcontenttype> and
@@ -619,7 +620,6 @@ DAV_DECLARE(dav_get_props_result) dav_get_allprops(dav_propdb *propdb,
                 }
 
                 if (what == DAV_PROP_INSERT_VALUE) {
-                    dav_error *err;
                     int found;
 
                     if ((err = (*db_hooks->output_value)(propdb->db, &name,
@@ -638,7 +638,7 @@ DAV_DECLARE(dav_get_props_result) dav_get_allprops(dav_propdb *propdb,
                 }
 
               next_key:
-                (void) (*db_hooks->next_name)(propdb->db, &name);
+                err = (*db_hooks->next_name)(propdb->db, &name);
             }
 
             /* all namespaces have been entered into xi. generate them into