mod_proxy_ftp: NULL pointer dereference on error paths.
[Stefan Fritsch <sf fritsch.de>, Joe Orton]
+ *) mod_dav_fs; Return 409 instead of 500 for a LOCK request if the parent
+ resource does not exist or is not a collection. PR 43465. [Stefan Fritsch]
+
*) mod_dav_fs: Return 409 instead of 500 for Litmus test case copy_nodestcoll
(a COPY request where the parent of the destination resource does not
exist). PR 39299. [Stefan Fritsch]
{
dav_error *err;
dav_resource *resource;
+ dav_resource *parent;
const dav_hooks_locks *locks_hooks;
int result;
int depth;
if (err != NULL)
return dav_handle_err(r, err, NULL);
+ /* Check if parent collection exists */
+ if ((err = resource->hooks->get_parent_resource(resource, &parent)) != NULL) {
+ /* ### add a higher-level description? */
+ return dav_handle_err(r, err, NULL);
+ }
+ if (parent && (!parent->exists || parent->collection != 1)) {
+ err = dav_new_error(r->pool, HTTP_CONFLICT, 0,
+ apr_psprintf(r->pool,
+ "The parent resource of %s does not "
+ "exist or is not a collection.",
+ ap_escape_html(r->pool, r->uri)));
+ return dav_handle_err(r, err, NULL);
+ }
+
/*
* Open writable. Unless an error occurs, we'll be
* writing into the database.