mirror of
https://github.com/zeromq/libzmq.git
synced 2025-04-26 18:11:31 +02:00
Merge pull request #3363 from bluca/tests_race_conditions
Problem: GCC warnings about string overflows in tests
This commit is contained in:
commit
f0d97e0243
@ -160,7 +160,7 @@ void test_connect_before_bind_ctx_term ()
|
|||||||
// Connect first
|
// Connect first
|
||||||
void *connect_socket = test_context_socket (ZMQ_ROUTER);
|
void *connect_socket = test_context_socket (ZMQ_ROUTER);
|
||||||
|
|
||||||
char ep[20];
|
char ep[32];
|
||||||
sprintf (ep, "inproc://cbbrr%d", i);
|
sprintf (ep, "inproc://cbbrr%d", i);
|
||||||
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, ep));
|
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, ep));
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ void test_issue_566 ()
|
|||||||
// Create dealer with unique explicit routing id
|
// Create dealer with unique explicit routing id
|
||||||
// We assume the router learns this out-of-band
|
// We assume the router learns this out-of-band
|
||||||
void *dealer = zmq_socket (ctx2, ZMQ_DEALER);
|
void *dealer = zmq_socket (ctx2, ZMQ_DEALER);
|
||||||
char routing_id[10];
|
// Leave space for NULL char from sprintf, gcc warning
|
||||||
|
char routing_id[11];
|
||||||
sprintf (routing_id, "%09d", cycle);
|
sprintf (routing_id, "%09d", cycle);
|
||||||
TEST_ASSERT_SUCCESS_ERRNO (
|
TEST_ASSERT_SUCCESS_ERRNO (
|
||||||
zmq_setsockopt (dealer, ZMQ_ROUTING_ID, routing_id, 10));
|
zmq_setsockopt (dealer, ZMQ_ROUTING_ID, routing_id, 10));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user