summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-11-10 05:28:06 -0800
committerGarrett D'Amore <garrett@damore.org>2019-11-10 05:28:06 -0800
commit20065fd19ecec1feadf8ba6c36724da6ac62d21d (patch)
treef9a37b007d1aa00ce458bb9ef25d7fdb9d728672
parentb58fe9af2ea7043b372b0101b82bf9715afb7e0b (diff)
downloadnng-20065fd19ecec1feadf8ba6c36724da6ac62d21d.tar.gz
nng-20065fd19ecec1feadf8ba6c36724da6ac62d21d.tar.bz2
nng-20065fd19ecec1feadf8ba6c36724da6ac62d21d.zip
fixes #1011 snprintf argument overflow in ws test code
-rw-r--r--tests/ws.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ws.c b/tests/ws.c
index 59d4d52d..56564c37 100644
--- a/tests/ws.c
+++ b/tests/ws.c
@@ -1,5 +1,5 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -171,7 +171,7 @@ TestMain("WebSocket Transport", {
So(nng_listener_getopt_int(
l1, NNG_OPT_TCP_BOUND_PORT, &port) == 0);
So(port != 0);
- snprintf(ws_url, 1023, "ws://*:%d/two", port);
+ snprintf(ws_url, sizeof(ws_url), "ws://*:%d/two", port);
So(nng_listen(s2, ws_url, NULL, 0) == 0);
});