aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/wps/httpread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wps/httpread.c b/src/wps/httpread.c
index 180b572..d6c2b62 100644
--- a/src/wps/httpread.c
+++ b/src/wps/httpread.c
@@ -506,10 +506,13 @@ static void httpread_read_handler(int sd, void *eloop_ctx, void *sock_ctx)
new_alloc_nbytes < (h->content_length + 1))
new_alloc_nbytes = h->content_length + 1;
if (new_alloc_nbytes < h->body_alloc_nbytes ||
- new_alloc_nbytes > h->max_bytes) {
+ new_alloc_nbytes > h->max_bytes +
+ HTTPREAD_BODYBUF_DELTA) {
wpa_printf(MSG_DEBUG,
- "httpread: Unacceptable body length %d",
- new_alloc_nbytes);
+ "httpread: Unacceptable body length %d (body_alloc_nbytes=%u max_bytes=%u)",
+ new_alloc_nbytes,
+ h->body_alloc_nbytes,
+ h->max_bytes);
goto bad;
}
if ((new_body = os_realloc(h->body, new_alloc_nbytes))