mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2026-05-07 06:08:03 +02:00
Don't let XFD_SETSIZE exceed FD_SETSIZE
This fixes 2c94cdb453 on the Hurd, as
FD_SETSIZE is only 256, and so anyone using XFD_SETSIZE to iterate over
the contents of an fd_set will overrun the array.
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
parent
edc04f87c7
commit
de30673937
1 changed files with 7 additions and 4 deletions
11
Xpoll.h.in
11
Xpoll.h.in
|
|
@ -67,10 +67,13 @@ typedef long fd_mask;
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#define XFD_SETSIZE 512
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE XFD_SETSIZE
|
||||
#if defined(FD_SETSIZE) && FD_SETSIZE < 512
|
||||
# define XFD_SETSIZE FD_SETSIZE
|
||||
#else
|
||||
# define XFD_SETSIZE 512
|
||||
# ifndef FD_SETSIZE
|
||||
# define FD_SETSIZE XFD_SETSIZE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef NBBY
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue