mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
connection: reject too large messages
Instead of silently truncating the message size in the header, simply reject the complete message.
This commit is contained in:
parent
ceb80723a9
commit
f29d7875cf
1 changed files with 4 additions and 1 deletions
|
|
@ -704,11 +704,14 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
|
|||
struct buffer *buf = &impl->out;
|
||||
int res;
|
||||
|
||||
if (size > 0xffffff)
|
||||
return -ENOSPC;
|
||||
|
||||
if ((p = connection_ensure_size(conn, buf, impl->hdr_size + size)) == NULL)
|
||||
return -errno;
|
||||
|
||||
p[0] = buf->msg.id;
|
||||
p[1] = (buf->msg.opcode << 24) | (size & 0xffffff);
|
||||
p[1] = (buf->msg.opcode << 24) | size;
|
||||
if (impl->version >= 3) {
|
||||
p[2] = buf->msg.seq;
|
||||
p[3] = buf->msg.n_fds;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue