diff --git a/common/ZMQWrappers.cpp b/common/ZMQWrappers.cpp index 0e110474..eee20dec 100644 --- a/common/ZMQWrappers.cpp +++ b/common/ZMQWrappers.cpp @@ -194,7 +194,8 @@ ZMQSocket &ZMQSocket::EnableKeepAlive() { std::string ZMQSocket::GetEndpointName() { char tmp[256]; - size_t len = 255; + size_t len = sizeof(tmp) - 1; + tmp[len] = '\0'; zmq_getsockopt(socket, ZMQ_LAST_ENDPOINT, tmp, &len); return tmp; }