From eb91fdd86141bc78c142a41994fce0a70ad11230 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Tue, 12 Jun 2018 20:14:04 +0200 Subject: [PATCH] httpd: fix missing null termination when searching for a default file in file system folder --- src/apps/http/httpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apps/http/httpd.c b/src/apps/http/httpd.c index c918577b..db5a57f4 100644 --- a/src/apps/http/httpd.c +++ b/src/apps/http/httpd.c @@ -2198,6 +2198,7 @@ http_find_file(struct http_state *hs, const char *uri, int is_09) size_t name_len = strlen(httpd_default_filenames[loop].name); size_t name_copy_len = LWIP_MIN(len_left, name_len); MEMCPY(&http_uri_buf[copy_len], httpd_default_filenames[loop].name, name_copy_len); + http_uri_buf[copy_len + name_copy_len] = 0; } file_name = http_uri_buf; } else