Public bug reported:
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("www.google.de", "80", &type, &address);
freeaddrinfo(address);
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(mmsg[0].msg_hdr) points to uninitialised byte(s)
==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_gethostbyname4_r (dns-host.c:313)
==46343== by 0x4EFDEEA: gaih_inet (getaddrinfo.c:842)
==46343== by 0x4F01E43: getaddrinfo (getaddrinfo.c:2417)
==46343== by 0x4005CC: main (in /home/sworddragon/data/test)
==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)
** Affects: glibc (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1096826
Title:
Syscall param sendmsg(mmsg[0].msg_hdr) points to uninitialised byte(s)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1096826/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs