]> git.sesse.net Git - vlc/commit
Whenever using select() companion macro FD_SET(), one must ensure that
authorRémi Denis-Courmont <rem@videolan.org>
Thu, 27 Apr 2006 20:18:14 +0000 (20:18 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 27 Apr 2006 20:18:14 +0000 (20:18 +0000)
commit0ee3f461252cc68d934f012a286c99418723ebf9
treedf80cbc17907664161146406b0f33d11db5dee94
parent3202dc4574fa78d24321e8f674625172ca4a95c5
Whenever using select() companion macro FD_SET(), one must ensure that
the specified file descriptor does not exceeds the fd_set limit (FD_SETSIZE).
Registering a file descriptor above this limit is not defined (read: this is
a buffer overflow).

This is not normally exploitable on Linux because FD_SETSIZE equals the
default limit for file descriptors per processes, but should work on BSDs.
Cygwin is also very prone to this problem (but right, we don't use it). As
for Windows, it will overflow if you try to select() more than 64 sockets at
a time (regardless of the total numbers of socket), but for the sake of
simplicity and portability, this patch actually prevent opening more than
64 sockets at all.

There are still quite a bunch of plugins that needs fixing.
modules/access/file.c
src/network/httpd.c
src/network/io.c
src/network/tcp.c