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:
7624a8b
)
test server post also take care about POST len termination
author
Andy Green
<andy@warmcat.com>
Sun, 8 May 2016 09:10:24 +0000
(17:10 +0800)
committer
Andy Green
<andy@warmcat.com>
Sun, 8 May 2016 09:10:24 +0000
(17:10 +0800)
Signed-off-by: Andy Green <andy@warmcat.com>
test-server/test-server-http.c
patch
|
blob
|
history
diff --git
a/test-server/test-server-http.c
b/test-server/test-server-http.c
index
32b36ba
..
215dc22
100644
(file)
--- a/
test-server/test-server-http.c
+++ b/
test-server/test-server-http.c
@@
-407,6
+407,8
@@
int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
lwsl_notice("LWS_CALLBACK_HTTP_BODY: len %d\n", (int)len);
strncpy(pss->post_string, in, sizeof (pss->post_string) -1);
pss->post_string[sizeof(pss->post_string) - 1] = '\0';
+ if (len < sizeof(pss->post_string) - 1)
+ pss->post_string[len] = '\0';
break;
case LWS_CALLBACK_HTTP_BODY_COMPLETION: