Subject: Buffer index protection in the case where client does not

receive content length from HTTP server
This commit is contained in:
Michael Behrns-Miller [case-ubuntu] 2017-03-02 09:46:41 -05:00 committed by Andy Green
parent faf260ccfa
commit 2495afa604

View file

@ -665,7 +665,10 @@ spin_chunks:
if (wsi->chunked)
return 0;
wsi->u.http.content_remain -= n;
/* if we know the content length, decrement the content remaining */
if (wsi->u.http.content_length > 0)
wsi->u.http.content_remain -= n;
if (wsi->u.http.content_remain || !wsi->u.http.content_length)
return 0;