diff options
| author | Steven Barth | 2015-06-22 14:36:16 +0200 |
|---|---|---|
| committer | sin | 2015-06-22 19:05:54 +0100 |
| commit | 0825063aa6725f8ddf6661ead3263072d630870c (patch) | |
| tree | 592deca62124a87577ce3cbfb223d69755d1d699 /include | |
| parent | 8ff214efe64637a398901ca59c887539ad2dc3fc (diff) | |
unistd: fix signed / unsigned comparison in getgroups
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/unistd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/unistd.h b/include/unistd.h index 45304e1..5274e22 100644 --- a/include/unistd.h +++ b/include/unistd.h | |||
| @@ -71,7 +71,7 @@ _FORTIFY_FN(getgroups) int getgroups(int __l, gid_t *__s) | |||
| 71 | { | 71 | { |
| 72 | size_t __b = __builtin_object_size(__s, 0); | 72 | size_t __b = __builtin_object_size(__s, 0); |
| 73 | 73 | ||
| 74 | if (__l > __b / sizeof(gid_t)) | 74 | if (__l < 0 || (size_t)__l > __b / sizeof(gid_t)) |
| 75 | __builtin_trap(); | 75 | __builtin_trap(); |
| 76 | return __orig_getgroups(__l, __s); | 76 | return __orig_getgroups(__l, __s); |
| 77 | } | 77 | } |
