This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/65280] New: -fsanitize=bounds does not detect out-of-bounds access
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Mar 2015 16:22:17 +0000
- Subject: [Bug sanitizer/65280] New: -fsanitize=bounds does not detect out-of-bounds access
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65280
Bug ID: 65280
Summary: -fsanitize=bounds does not detect out-of-bounds access
Product: gcc
Version: 5.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
void
foo (int n, int (*b)[n])
{
(*b)[n] = 1;
}
int
main ()
{
int a[20];
foo (3, (int (*)[3]) &a);
}
We issue no runtime error here, while clang says:
u.c:5:2: runtime error: index 3 out of bounds for type 'int [n]'