Fixed crash on negative Content-Length in header

This commit is contained in:
Stefan Ritt 2017-12-06 13:34:34 +01:00
parent c1866af75b
commit fe36e068f6

View File

@ -29204,6 +29204,11 @@ int process_http_request(const char *request, int i_conn)
content_length = atoi(strstr(request, "Content-Length:") + 15);
else if (strstr(request, "Content-length:"))
content_length = atoi(strstr(request, "Content-length:") + 15);
if (content_length <= 0) {
show_error("Invalid Content-Length in header");
xfree(str);
return 1;
}
/* extract header length */
if (strstr(request, "\r\n\r\n"))