diff --git a/httpd/httpd.c b/httpd/httpd.c index 7b90adf..561bd93 100644 --- a/httpd/httpd.c +++ b/httpd/httpd.c @@ -272,7 +272,8 @@ __xdata uint8_t *scan_header(__xdata uint8_t *p) dbg_string("\nFound multipart\n"); content_type += 30; uint8_t i = 0; - while (content_type[i] != '\r' && content_type[i] != '\n') { + while (i < (sizeof(boundary) - 5) && + content_type[i] != '\r' && content_type[i] != '\n') { boundary[i + 4] = content_type[i]; i++; }