GCC Bugzilla – Attachment 32963 Details for
Bug 61547
Invalid sanitization of trailing byte in __builtin_strlen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Reprocase
repro.c (text/plain), 780 bytes, created by
Yury Gribov
on 2014-06-18 09:52:14 UTC
(
hide
)
Description:
Reprocase
Filename:
MIME Type:
Creator:
Yury Gribov
Created:
2014-06-18 09:52:14 UTC
Size:
780 bytes
patch
obsolete
>/* { dg-do run } */ >/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ >/* { dg-shouldfail "asan" } */ > >#include <sanitizer/asan_interface.h> > >char a[2] = "0"; > >#ifdef __cplusplus >extern "C" >#endif >__SIZE_TYPE__ strlen (const char *p) { > /* Simulate error */ > if (p == a) > return 1; > > __SIZE_TYPE__ n = 0; > for (; *p; ++n, ++p); > return n; >} > >int main () { > char *p = &a[0]; > asm ("" : "+r"(p)); > __asan_poison_memory_region ((char *)&a[1], 1); > return __builtin_strlen (a); >} > >/* { dg-output "READ of size 1 at 0x\[0-9a-f\]+ thread T0.*(\n|\r\n|\r)" } */ >/* { dg-output " #0 0x\[0-9a-f\]+ (in _*main (\[^\n\r]*strlen-overflow-1.c:26|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */ >/* { dg-output "\[^\n\r]*0x\[0-9a-f\]+ is located 1 bytes inside of global variable" } */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 61547
: 32963 |
32964