Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 83 by
rol...@rschulz.eu: getlogin_r + strlen false positive
https://code.google.com/p/memory-sanitizer/issues/detail?id=83
The code:
#include <unistd.h>
#include <stdio.h>
#include <string.h>
int main()
{
char buf[20];
getlogin_r(buf,20);
printf("%s %lu\n", buf, strlen(buf));
return 0;
}
Produces
Uninitialized bytes in __interceptor_strlen at offset 0 inside
[0x7fffadd55e40, 8)
==1510== WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7fac569fbf0a in main (/home/rschulz/work/msan/a.out+0x90f0a)
#1 0x7fac55880b04 in __libc_start_main (/lib64/libc.so.6+0x21b04)
#2 0x7fac569a6a5e in _start
/home/abuild/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S:112
Uninitialized value was created by an allocation of 'buf' in the stack
frame of function 'main'
#0 0x7fac569fbe70 in main (/home/rschulz/work/msan/a.out+0x90e70)
This is with both clang 3.5.0 and 3.6.0rc1.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings