From 767bded576b5ae64797182041a324ab32994e0cf Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 27 Apr 2013 17:52:03 +0000 Subject: [PATCH] mod_dav: Do not segfault on PROPFIND with a zero length DBM. PR 52559 Submitted by: Diego Santa Cruz Tested by William Lewis git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476645 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/dav/main/props.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index d6cf692147..5d0b53c88f 100644 --- 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 ] + *) mod_dav: Do not fail PROPPATCH when prop namespace is not known. PR 52559 [Diego Santa Cruz ] diff --git a/modules/dav/main/props.c b/modules/dav/main/props.c index 19c7b11aef..507ba52d8b 100644 --- a/modules/dav/main/props.c +++ b/modules/dav/main/props.c @@ -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 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 -- 2.40.0