Skip to content

Commit 5bf7c9c

Browse files
committed
* modules/dav/main/ms_wdv.c (mswdv_combined_proppatch): Drop redundant
check of proppatch_len against APR_SIZE_MAX, update comment. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1931184 13f79535-47bb-0310-9956-ffa450edef68
1 parent bd61fb9 commit 5bf7c9c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

modules/dav/main/ms_wdv.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,15 +619,17 @@ static dav_error *mswdv_combined_proppatch(request_rec *r)
619619
return dav_new_error(r->pool, HTTP_BAD_REQUEST, 0, status,
620620
"Bad PROPPATCH part length");
621621

622-
/* Validate PROPPATCH length against configured limits */
622+
/* Validate PROPPATCH length against configured limits. Note
623+
* ap_get_limit_xml_body() has a maximum of AP_MAX_LIMIT_XML_BODY
624+
* giving a safe upper bound to in-memory caching. */
623625
limit = ap_get_limit_xml_body(r);
624626
if (limit > 0 && proppatch_len > limit) {
625627
return dav_new_error(r->pool, HTTP_REQUEST_ENTITY_TOO_LARGE, 0, 0,
626628
"PROPPATCH part length exceeds configured limit");
627629
}
628-
if (proppatch_len <= 0 || proppatch_len > (apr_off_t)APR_SIZE_MAX) {
629-
return dav_new_error(r->pool, HTTP_REQUEST_ENTITY_TOO_LARGE, 0, 0,
630-
"PROPPATCH part length invalid or too large");
630+
if (proppatch_len <= 0) {
631+
return dav_new_error(r->pool, HTTP_BAD_REQUEST, 0, 0,
632+
"invalid or negative PROPPATCH part length");
631633
}
632634

633635
apr_brigade_destroy(bb);

0 commit comments

Comments
 (0)