mirror of
https://github.com/apache/httpd.git
synced 2025-07-25 17:01:22 +00:00
Use ap_parse_strict_length() to parse client-supplied Content-Length
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908144 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -320,13 +320,21 @@ int dav_fs_quota_precondition(request_rec *r,
|
|||||||
/*
|
/*
|
||||||
* If PUT has Content-Length, we can forecast overquota
|
* If PUT has Content-Length, we can forecast overquota
|
||||||
*/
|
*/
|
||||||
if ((lenhdr = apr_table_get(r->headers_in, "Content-Length")) &&
|
if (lenhdr = apr_table_get(r->headers_in, "Content-Length")) {
|
||||||
(atol(lenhdr) > available_bytes)) {
|
if (!ap_parse_strict_length(&size, lenhdr)) {
|
||||||
|
status = HTTP_BAD_REQUEST;
|
||||||
|
*err = dav_new_error(r->pool, status, 0, 0,
|
||||||
|
"client sent invalid Content-Length");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size > available_bytes) {
|
||||||
status = HTTP_INSUFFICIENT_STORAGE;
|
status = HTTP_INSUFFICIENT_STORAGE;
|
||||||
*err = dav_new_error_tag(r->pool, status, 0, 0,
|
*err = dav_new_error_tag(r->pool, status, 0, 0,
|
||||||
msg, NULL, tag);
|
msg, NULL, tag);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case M_COPY: /* FALLTHROUGH */
|
case M_COPY: /* FALLTHROUGH */
|
||||||
case M_MOVE:
|
case M_MOVE:
|
||||||
|
Reference in New Issue
Block a user