Skip to content
  • David Herrmann's avatar
    connection: fix buffer-overflow in close_fds() · 9bd41ed6
    David Herrmann authored
    
    
    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>
    9bd41ed6