fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit 2f0e3f574f74e85f2a38aebc141f3d6fbc380910
parent 2ea31ca96f0e836b7477a52b3c15f313f69c1098
Author: sin <sin@2f30.org>
Date:   Sat, 28 Feb 2015 14:52:09 +0000

Don't include stddef.h from poll.h

Diffstat:
Minclude/poll.h | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/poll.h b/include/poll.h @@ -1,7 +1,6 @@ #ifndef FORTIFY_POLL_H_ #define FORTIFY_POLL_H_ -#include_next <stddef.h> #include_next <poll.h> #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 @@ -10,9 +9,9 @@ static inline __attribute__ ((always_inline)) int __fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) { - size_t bos = __builtin_object_size(fds, 0); - if (bos != -1 && nfds > bos / sizeof(struct pollfd)) + if (__builtin_object_size(fds, 0) != -1 && + nfds > __builtin_object_size(fds, 0) / sizeof(struct pollfd)) __builtin_trap(); return poll(fds, nfds, timeout); }