summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/poll.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/poll.h b/include/poll.h
index 54fc4ab..cbc78fd 100644
--- a/include/poll.h
+++ b/include/poll.h
@@ -1,7 +1,6 @@
1#ifndef FORTIFY_POLL_H_ 1#ifndef FORTIFY_POLL_H_
2#define FORTIFY_POLL_H_ 2#define FORTIFY_POLL_H_
3 3
4#include_next <stddef.h>
5#include_next <poll.h> 4#include_next <poll.h>
6 5
7#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
@@ -10,9 +9,9 @@ static inline __attribute__ ((always_inline))
10int 9int
11__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) 10__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout)
12{ 11{
13 size_t bos = __builtin_object_size(fds, 0);
14 12
15 if (bos != -1 && nfds > bos / sizeof(struct pollfd)) 13 if (__builtin_object_size(fds, 0) != -1 &&
14 nfds > __builtin_object_size(fds, 0) / sizeof(struct pollfd))
16 __builtin_trap(); 15 __builtin_trap();
17 return poll(fds, nfds, timeout); 16 return poll(fds, nfds, timeout);
18} 17}