From 904d0bd8d3846f858f5c8ab31f9d1e84839dfd3b Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 4 Nov 2016 12:13:14 +0000 Subject: [PATCH] Problem: socket_type_string off-by-one error Solution: check socket type from 0 to 11 to include ZMQ_STREAM --- src/mechanism.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mechanism.cpp b/src/mechanism.cpp index 84f15dad..940ba53f 100644 --- a/src/mechanism.cpp +++ b/src/mechanism.cpp @@ -75,7 +75,7 @@ const char *zmq::mechanism_t::socket_type_string (int socket_type) const static const char *names [] = {"PAIR", "PUB", "SUB", "REQ", "REP", "DEALER", "ROUTER", "PULL", "PUSH", "XPUB", "XSUB", "STREAM"}; - zmq_assert (socket_type >= 0 && socket_type <= 10); + zmq_assert (socket_type >= 0 && socket_type <= 11); return names [socket_type]; }