mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-14 20:33:48 +00:00
Fixed crash on negative Content-Length in header
This commit is contained in:
parent
c1866af75b
commit
fe36e068f6
@ -29204,6 +29204,11 @@ int process_http_request(const char *request, int i_conn)
|
|||||||
content_length = atoi(strstr(request, "Content-Length:") + 15);
|
content_length = atoi(strstr(request, "Content-Length:") + 15);
|
||||||
else if (strstr(request, "Content-length:"))
|
else if (strstr(request, "Content-length:"))
|
||||||
content_length = atoi(strstr(request, "Content-length:") + 15);
|
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 */
|
/* extract header length */
|
||||||
if (strstr(request, "\r\n\r\n"))
|
if (strstr(request, "\r\n\r\n"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user