From 117cbe690cd114777588c05ca62b39e6ef034dc1 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 15 Jan 2023 22:12:26 +0000 Subject: [PATCH] Problem: buffer overflow in new test case Solution: fix it --- tests/test_pubsub_topics_count.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_pubsub_topics_count.cpp b/tests/test_pubsub_topics_count.cpp index f4fdbcc0..5f6d9ecf 100644 --- a/tests/test_pubsub_topics_count.cpp +++ b/tests/test_pubsub_topics_count.cpp @@ -126,11 +126,11 @@ void test_nested_topic_prefixes () // Subscribe to other 3 (nested) topics TEST_ASSERT_SUCCESS_ERRNO ( - zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xyz", strlen ("a"))); + zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xyz", strlen ("xyz"))); TEST_ASSERT_SUCCESS_ERRNO ( - zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xy", strlen ("ab"))); + zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xy", strlen ("xy"))); TEST_ASSERT_SUCCESS_ERRNO ( - zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "x", strlen ("abc"))); + zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "x", strlen ("x"))); TEST_ASSERT_EQUAL_INT (get_subscription_count (subscriber), 6); TEST_ASSERT_EQUAL_INT (get_subscription_count (publisher), 6);