unistd: fix signed / unsigned comparison in getgroups
Signed-off-by: Steven Barth <steven@midlink.org>
This commit is contained in:
parent
8ff214efe6
commit
0825063aa6
|
@ -71,7 +71,7 @@ _FORTIFY_FN(getgroups) int getgroups(int __l, gid_t *__s)
|
|||
{
|
||||
size_t __b = __builtin_object_size(__s, 0);
|
||||
|
||||
if (__l > __b / sizeof(gid_t))
|
||||
if (__l < 0 || (size_t)__l > __b / sizeof(gid_t))
|
||||
__builtin_trap();
|
||||
return __orig_getgroups(__l, __s);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue