From d5d30d49f2d1dad7cf3381351e2e944a7de1c0ff Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 2 Feb 2018 21:31:36 +0100 Subject: [PATCH] httpd: check that file data is present when dynamic read is disabled Signed-off-by: goldsimon --- src/apps/httpd/httpd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index 946bbc5f..f0992854 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -2276,6 +2276,11 @@ http_init_file(struct http_state *hs, struct fs_file *file, int is_09, const cha { if (file != NULL) { /* file opened, initialise struct http_state */ +#if !LWIP_HTTPD_DYNAMIC_FILE_READ + /* If dynamic read is disabled, file data must be in one piece and available now */ + LWIP_ASSERT("file->data != NULL", file->data != NULL); +#endif + #if LWIP_HTTPD_SSI if (tag_check) { struct http_ssi_state *ssi = http_ssi_state_alloc();