Add ppoll() check
This commit is contained in:
parent
15c2b9d8df
commit
7279c33202
|
@ -16,9 +16,28 @@ __fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
|||
return poll(fds, nfds, timeout);
|
||||
}
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
int
|
||||
__fortify_ppoll(struct pollfd *fds, nfds_t nfds,
|
||||
const struct timespec *timeout, const sigset_t *mask)
|
||||
{
|
||||
__typeof__(sizeof 0) bos = __builtin_object_size(fds, 0);
|
||||
|
||||
if (nfds > bos / sizeof(struct pollfd))
|
||||
__builtin_trap();
|
||||
return ppoll(fds, nfds, timeout, mask);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#undef poll
|
||||
#define poll(fds, nfds, timeout) __fortify_poll(fds, nfds, timeout)
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#undef ppoll
|
||||
#define ppoll(fds, nfds, timeout, mask) __fortify_ppoll(fds, nfds, timeout, mask)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue