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:
0fba8e6
)
coverity 158147 test ping sprintf bounds
author
Andy Green
<andy.green@linaro.org>
Mon, 15 Feb 2016 13:08:18 +0000
(21:08 +0800)
committer
Andy Green
<andy.green@linaro.org>
Mon, 15 Feb 2016 13:09:00 +0000
(21:09 +0800)
Well, just in the test app arg processing, but yes...
Signed-off-by: Andy Green <andy.green@linaro.org>
test-server/test-ping.c
patch
|
blob
|
history
diff --git
a/test-server/test-ping.c
b/test-server/test-ping.c
index
1548f1c
..
ff2d8e3
100644
(file)
--- a/
test-server/test-ping.c
+++ b/
test-server/test-ping.c
@@
-450,7
+450,8
@@
int main(int argc, char **argv)
/* create client websockets using dumb increment protocol */
address = argv[optind];
- sprintf(ads_port, "%s:%u", address, port & 65535);
+ snprintf(ads_port, sizeof(ads_port), "%s:%u",
+ address, port & 65535);
lwsl_notice("Connecting to %s...\n", ads_port);
memset(&i, 0, sizeof(i));
i.context = context;