diff options
| author | sin | 2015-02-28 20:49:00 +0000 |
|---|---|---|
| committer | sin | 2015-02-28 20:50:34 +0000 |
| commit | e71d1fd257717987239380f52c25026e634c6a81 (patch) | |
| tree | 1a6b0bd2d7e1f4c28758cbeba0da62a53e2e38a6 | |
| parent | de499b92ba1539dde59a8f788807950229d03897 (diff) | |
Remove redundant checks
We can never have an array of more than SIZE_MAX/2/sizeof(gid_t)
gid_t's.
| -rw-r--r-- | include/poll.h | 2 | ||||
| -rw-r--r-- | include/unistd.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/poll.h b/include/poll.h index 83801bd..4eb2713 100644 --- a/include/poll.h +++ b/include/poll.h | |||
| @@ -11,7 +11,7 @@ __fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) | |||
| 11 | { | 11 | { |
| 12 | __typeof__(sizeof 0) bos = __builtin_object_size(fds, 0); | 12 | __typeof__(sizeof 0) bos = __builtin_object_size(fds, 0); |
| 13 | 13 | ||
| 14 | if (bos != -1 && nfds > bos / sizeof(struct pollfd)) | 14 | if (nfds > bos / sizeof(struct pollfd)) |
| 15 | __builtin_trap(); | 15 | __builtin_trap(); |
| 16 | return poll(fds, nfds, timeout); | 16 | return poll(fds, nfds, timeout); |
| 17 | } | 17 | } |
diff --git a/include/unistd.h b/include/unistd.h index d019b51..6b502b5 100644 --- a/include/unistd.h +++ b/include/unistd.h | |||
| @@ -46,7 +46,7 @@ __fortify_getgroups(int len, gid_t *set) | |||
| 46 | { | 46 | { |
| 47 | size_t bos = __builtin_object_size(set, 0); | 47 | size_t bos = __builtin_object_size(set, 0); |
| 48 | 48 | ||
| 49 | if (bos != -1 && len > bos / sizeof(gid_t)) | 49 | if (len > bos / sizeof(gid_t)) |
| 50 | __builtin_trap(); | 50 | __builtin_trap(); |
| 51 | return getgroups(len, set); | 51 | return getgroups(len, set); |
| 52 | } | 52 | } |
