projects
/
platform
/
upstream
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
faf260c
)
Subject: Buffer index protection in the case where client does not
author
Michael Behrns-Miller [case-ubuntu]
<m@bitpost.com>
Thu, 2 Mar 2017 14:46:41 +0000
(09:46 -0500)
committer
Andy Green
<andy@warmcat.com>
Thu, 2 Mar 2017 21:41:39 +0000
(
05:41
+0800)
receive content length from HTTP server
lib/service.c
patch
|
blob
|
history
diff --git
a/lib/service.c
b/lib/service.c
index
48726c1
..
31c96b1
100644
(file)
--- a/
lib/service.c
+++ b/
lib/service.c
@@
-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;