Skip to content
Commit 9bd41ed6 authored by David Herrmann's avatar David Herrmann Committed by Kristian Høgsberg
Browse files

connection: fix buffer-overflow in close_fds()



If we push two messages via wl_connection_write() and both messages
contain more than MAX_FDS_OUT file-descriptors combined, then
wl_connection_flush() will write only MAX_FDS_OUT of them, but close all
pending ones, too.

Furthermore, close_fds() will copy more FDs out of the buffer than it can
hold and cause a buffer overflow. Therefore, we simply pass a maximum
limit to close_fds().

During shutdown, we simply close all available FDs.

Signed-off-by: default avatarDavid Herrmann <dh.herrmann@googlemail.com>
parent cda89f3a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment