fortify-headers/include
info@mobile-stream.com 9e65ae387c getgroups: do not trap on non-positive gidsetsize
First, we should never check the size of __s if __l == 0 since the
array is not going to be modified in that case.

Second, negative __l is a well-defined error case (EINVAL) and we
should never trap on a conforming code like this:

r = getgroups(-1, NULL);
if (r == -1)
  ...

An example of non-desired behaviour for negative __l is the gnulib
configure script which checks for getgroups(-1, ...) to catch some
ancient FreeBSD kernel bug. The conftest binary traps even on good
system (e.g. linux/musl) and the unnecessary getgroups wrapper is
enforced for any project that uses gnulib.

This patch also changes the size_t cast to avoid the explicit zero
extension on systems where size_t differs from unsigned int.
2019-03-13 17:47:50 +00:00
..
sys Don't use __extension__ in C++ code 2018-07-24 11:00:30 +01:00
fortify-headers.h Bump copyright year 2016-09-10 12:54:17 +01:00
poll.h Don't use __extension__ in C++ code 2018-07-24 11:00:30 +01:00
stdio.h Don't use __extension__ in C++ code 2018-07-24 11:00:30 +01:00
stdlib.h realpath: guard slow/trap path with PATH_MAX 2019-03-07 00:05:30 +00:00
string.h Make use of builtins whenever possible 2019-02-25 13:17:08 +00:00
strings.h Bump copyright year 2016-09-10 12:54:17 +01:00
unistd.h getgroups: do not trap on non-positive gidsetsize 2019-03-13 17:47:50 +00:00
wchar.h wctomb, wcrtomb: guard slow/trap path with MB_LEN_MAX 2019-03-07 00:05:34 +00:00