[Bug sanitizer/80797] New: -fsanitize=null doesn't instrument &s->x
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 17 07:34:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80797
Bug ID: 80797
Summary: -fsanitize=null doesn't instrument &s->x
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
Target Milestone: ---
Discovered in PR80768:
struct S
{
int i;
};
int
main ()
{
struct S *s = 0;
int *v = &s->i;
int *v2 = &(*s).i;
return 0;
}
is not instrumented by gcc, but is by clang:
s.c:10:16: runtime error: member access within null pointer of type 'struct S'
s.c:11:14: runtime error: member access within null pointer of type 'struct S'
More information about the Gcc-bugs
mailing list