Commit 102101e9 authored by Sergey Lyubka's avatar Sergey Lyubka

Corrected dangerous assert() in process_new_connection

parent b68b0e3e
......@@ -4042,7 +4042,7 @@ static void process_new_connection(struct mg_connection *conn) {
reset_per_request_attributes(conn);
conn->request_len = read_request(NULL, conn, conn->buf, conn->buf_size,
&conn->data_len);
assert(conn->data_len >= conn->request_len);
assert(conn->request_len < 0 || conn->data_len >= conn->request_len);
if (conn->request_len == 0 && conn->data_len == conn->buf_size) {
send_http_error(conn, 413, "Request Too Large", "");
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment