mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-16 21:37:49 -04:00
connection: return error if too many fds in message
Check that the number of fds in the message doesn't exceed our max or else we might overflow the fd buffer a little later.
This commit is contained in:
parent
79b4aba6cc
commit
f3fc645496
1 changed files with 2 additions and 1 deletions
|
|
@ -538,7 +538,8 @@ static int prepare_packet(struct pw_protocol_native_connection *conn, struct buf
|
|||
size -= impl->hdr_size;
|
||||
buf->msg.fds = &buf->fds[buf->fds_offset];
|
||||
|
||||
if (buf->msg.n_fds + buf->fds_offset > buf->n_fds)
|
||||
if (buf->msg.n_fds > MAX_FDS ||
|
||||
buf->msg.n_fds + buf->fds_offset > buf->n_fds)
|
||||
return -EPROTO;
|
||||
|
||||
if (size < len)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue