Syscall param sendmsg(mmsg[0].msg_hdr) points to uninitialised byte(s)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I'm using Ubuntu 13.04 dev with libc6-dev 2.16-0ubuntu8. The following code causes valgrind to show a warning:
#include <netdb.h>
int main()
{
struct addrinfo *address, type;
type.ai_family = AF_UNSPEC;
type.ai_flags = 0;
type.ai_protocol = 0;
type.ai_socktype = 0;
getaddrinfo(
freeaddrinfo(
return 0;
}
The code was compiled with "gcc -o test test.c" and "valgrind ./test" shows:
==46343== Memcheck, a memory error detector
==46343== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==46343== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==46343== Command: ./test
==46343==
==46343== Syscall param sendmsg(
==46343== at 0x4F2CEA9: sendmmsg (sendmmsg.c:32)
==46343== by 0x5A158ED: __libc_res_nsend (res_send.c:1140)
==46343== by 0x5A12D3B: __libc_res_nquery (res_query.c:226)
==46343== by 0x5A136D8: __libc_res_nsearch (res_query.c:582)
==46343== by 0x5805B37: _nss_dns_
==46343== by 0x4EFDEEA: gaih_inet (getaddrinfo.c:842)
==46343== by 0x4F01E43: getaddrinfo (getaddrinfo.
==46343== by 0x4005CC: main (in /home/sworddrag
==46343== Address 0x7feffe330 is on thread 1's stack
==46343==
==46343==
==46343== HEAP SUMMARY:
==46343== in use at exit: 0 bytes in 0 blocks
==46343== total heap usage: 63 allocs, 63 frees, 10,182 bytes allocated
==46343==
==46343== All heap blocks were freed -- no leaks are possible
==46343==
==46343== For counts of detected and suppressed errors, rerun with: -v
==46343== Use --track-origins=yes to see where uninitialised values come from
==46343== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 2 from 2)
Status changed to 'Confirmed' because the bug affects multiple users.