+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
--- /dev/null
+/* 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;
+}
+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
// 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);