diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2016-07-05 16:34:04 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2016-07-05 16:34:04 -0400 |
commit | 28841bfc3dee3c80cc8feb3fe89e1f5803fddfc3 (patch) | |
tree | 3cf3a42417183baff776c3d6442722a8ad9cd437 | |
parent | d6c60ebbff85a466bf94634f40964f1a26ad543f (diff) | |
download | lighttpd-git-28841bfc3dee3c80cc8feb3fe89e1f5803fddfc3.tar.gz |
[core] fix server.max-request-size to be precise (fixes #2131)
(previously would allow up to 1k data above configured limit)
x-ref:
"max-request-size comparing mistake"
https://redmine.lighttpd.net/issues/2131
-rw-r--r-- | src/request.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/request.c b/src/request.c index 50898602..72be9c44 100644 --- a/src/request.c +++ b/src/request.c @@ -1277,9 +1277,9 @@ int http_request_parse(server *srv, connection *con) { return 0; } - /* divide by 1024 as srvconf.max_request_size is in kBytes */ + /* srvconf.max_request_size is in kBytes */ if (srv->srvconf.max_request_size != 0 && - (con->request.content_length >> 10) > srv->srvconf.max_request_size) { + (off_t)con->request.content_length > ((off_t)srv->srvconf.max_request_size << 10)) { /* the request body itself is larger then * our our max_request_size */ |