Browse Source

[mod_webdav] fix theoretical NULL dereference

fix theoretical NULL dereference identified by Coverity Scan

possible for PROPFIND with specific atypical choices in lighttpd.conf:
- possible for getcontenttype if no content type matches resource
  and no default type configured in lighttpd.conf
- possible for getetag if etag disabled in lighttpd.conf
personal/stbuehler/ci-build
Glenn Strauss 1 year ago
parent
commit
10b7aedcdb
  1. 13
      src/mod_webdav.c

13
src/mod_webdav.c

@ -3172,7 +3172,18 @@ webdav_propfind_resource_props (const webdav_propfind_bufs * const restrict pb)
continue;
/*(error obtaining prop if reached)*/
webdav_xml_prop(pb->b_404, prop, NULL, 0);
if (prop->name)
webdav_xml_prop(pb->b_404, prop, NULL, 0);
else {
const struct live_prop_list *list = live_properties;
while (0 != list->len && (uint32_t)list->pnum != prop->namelen)
++list;
if (0 != list->len) { /*(list->pnum == prop->namelen)*/
webdav_property_name lprop =
{ prop->ns, list->prop, prop->nslen, list->len };
webdav_xml_prop(pb->b_404, &lprop, NULL, 0);
}
}
}
}

Loading…
Cancel
Save