Remove redundant checks
We can never have an array of more than SIZE_MAX/2/sizeof(gid_t) gid_t's.
This commit is contained in:
parent
de499b92ba
commit
e71d1fd257
|
@ -11,7 +11,7 @@ __fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
|||
{
|
||||
__typeof__(sizeof 0) bos = __builtin_object_size(fds, 0);
|
||||
|
||||
if (bos != -1 && nfds > bos / sizeof(struct pollfd))
|
||||
if (nfds > bos / sizeof(struct pollfd))
|
||||
__builtin_trap();
|
||||
return poll(fds, nfds, timeout);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ __fortify_getgroups(int len, gid_t *set)
|
|||
{
|
||||
size_t bos = __builtin_object_size(set, 0);
|
||||
|
||||
if (bos != -1 && len > bos / sizeof(gid_t))
|
||||
if (len > bos / sizeof(gid_t))
|
||||
__builtin_trap();
|
||||
return getgroups(len, set);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue