ZMQWrappers: Add explicit null termination to ZMQSocket::GetEndpointName()

This commit is contained in:
2026-04-16 08:03:42 +02:00
parent 39a7024274
commit 48e1f4fb7d
+2 -1
View File
@@ -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;
}