summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/poll.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/poll.h b/include/poll.h
index cbc78fd..83801bd 100644
--- a/include/poll.h
+++ b/include/poll.h
@@ -9,9 +9,9 @@ static inline __attribute__ ((always_inline))
9int 9int
10__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) 10__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout)
11{ 11{
12 __typeof__(sizeof 0) bos = __builtin_object_size(fds, 0);
12 13
13 if (__builtin_object_size(fds, 0) != -1 && 14 if (bos != -1 && nfds > bos / sizeof(struct pollfd))
14 nfds > __builtin_object_size(fds, 0) / sizeof(struct pollfd))
15 __builtin_trap(); 15 __builtin_trap();
16 return poll(fds, nfds, timeout); 16 return poll(fds, nfds, timeout);
17} 17}