From 21e076cb563ee360b978af3e3564d613f5e56810 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 20 Feb 2014 21:19:27 +0100 Subject: [PATCH] patch #8097 httpd: Return failure if parsing Content-Length fails --- apps/httpserver_raw/httpd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/httpserver_raw/httpd.c b/apps/httpserver_raw/httpd.c index c7076d6..df842db 100644 --- a/apps/httpserver_raw/httpd.c +++ b/apps/httpserver_raw/httpd.c @@ -1787,6 +1787,11 @@ http_post_request(struct pbuf **inp, struct http_state *hs, } } } + /* If we come here, headers are fully received (double-crlf), but Content-Length + was not included. Since this is currently the only supported method, we have + to fail in this case! */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Error when parsing Content-Length\n")); + return ERR_ARG; } /* if we come here, the POST is incomplete */ #if LWIP_HTTPD_SUPPORT_REQUESTLIST