fortify-headers

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

commit 0825063aa6725f8ddf6661ead3263072d630870c
parent 8ff214efe64637a398901ca59c887539ad2dc3fc
Author: Steven Barth <steven@midlink.org>
Date:   Mon, 22 Jun 2015 14:36:16 +0200

unistd: fix signed / unsigned comparison in getgroups

Signed-off-by: Steven Barth <steven@midlink.org>

Diffstat:
include/unistd.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/unistd.h b/include/unistd.h @@ -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); }