mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 10:54:07 +08:00
Cherry-pick upstream r299036 from libsanitizer (PR sanitizer/80166).
2017-04-06 Martin Liska <mliska@suse.cz> PR sanitizer/80166 * sanitizer_common/sanitizer_common_interceptors.inc (INTERCEPTOR): Cherry-pick upstream r299036. 2017-04-06 Martin Liska <mliska@suse.cz> PR sanitizer/80166 * gcc.dg/asan/pr80166.c: New test. From-SVN: r246730
This commit is contained in:
parent
1b68991f4d
commit
d9f8c5af8b
@ -1,3 +1,8 @@
|
||||
2017-04-06 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR sanitizer/80166
|
||||
* gcc.dg/asan/pr80166.c: New test.
|
||||
|
||||
2017-04-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
PR tree-optimization/79390
|
||||
|
24
gcc/testsuite/gcc.dg/asan/pr80166.c
Normal file
24
gcc/testsuite/gcc.dg/asan/pr80166.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* PR sanitizer/80166 */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
gid_t groups;
|
||||
int r = getgroups (0, &groups);
|
||||
if (r < 0)
|
||||
__builtin_abort ();
|
||||
|
||||
r = getgroups (-1, &groups);
|
||||
if (r != -1)
|
||||
__builtin_abort ();
|
||||
|
||||
r = getgroups (-1, NULL);
|
||||
if (r != -1)
|
||||
__builtin_abort ();
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,3 +1,9 @@
|
||||
2017-04-06 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR sanitizer/80166
|
||||
* sanitizer_common/sanitizer_common_interceptors.inc (INTERCEPTOR):
|
||||
Cherry-pick upstream r299036.
|
||||
|
||||
2017-03-22 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR sanitizer/78158
|
||||
|
@ -3350,7 +3350,8 @@ INTERCEPTOR(int, getgroups, int size, u32 *lst) {
|
||||
// its metadata. See
|
||||
// https://github.com/google/sanitizers/issues/321.
|
||||
int res = REAL(getgroups)(size, lst);
|
||||
if (res && lst) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, lst, res * sizeof(*lst));
|
||||
if (res >= 0 && lst && size > 0)
|
||||
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, lst, res * sizeof(*lst));
|
||||
return res;
|
||||
}
|
||||
#define INIT_GETGROUPS COMMON_INTERCEPT_FUNCTION(getgroups);
|
||||
|
Loading…
Reference in New Issue
Block a user