ZMQWrappers: Add explicit null termination to ZMQSocket::GetEndpointName()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user