net: cap aggregate ZMQ receive size

This commit is contained in:
selsta
2026-06-10 19:49:23 +02:00
parent a8478d21b2
commit d72cd7fc16
3 changed files with 10 additions and 2 deletions
+6
View File
@@ -150,6 +150,12 @@ namespace zmq
if ((last = zmq_msg_recv(part.handle(), socket, flags)) < 0)
return last;
if (max_message_size < payload.size() ||
max_message_size - payload.size() < part.size())
{
errno = EMSGSIZE;
return -1;
}
payload.append(part.data(), part.size());
if (!zmq_msg_more(part.handle()))
break;