Bug#692433: getaddrinfo: Syscall param socketcall.connect(serv_addr.sin6_addr) points to uninitialised byte(s)
Package: libc6
Version: 2.13-36
Severity: normal
Dear Maintainer,
when calling getaddrinfo(), valgrind detects:
==7051== Syscall param socketcall.connect(serv_addr.sin6_addr) points to uninitialised byte(s)
==7051== at 0x362E6DB780: __connect_nocancel (syscall-template.S:82)
==7051== by 0x362E6B9307: getaddrinfo (getaddrinfo.c:2279)
==7051== by 0x4006A3: main (x.c:17)
==7051== Address 0x7feffff10 is on thread 1's stack
==7051== Uninitialised value was created by a stack allocation
==7051== at 0x362E6B8FD0: getaddrinfo (getaddrinfo.c:2092)
Here is the short C source to reproduce the problem (gcc -g x.c -o x):
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
void main(void)
{
struct addrinfo *addrinfo = NULL;
struct addrinfo hints;
memset(&hints,0,sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_NUMERICSERV;
if (getaddrinfo("www.example.com", "80", &hints, &addrinfo) == 0)
freeaddrinfo(addrinfo);
}
This problem is pretty new, maybe introduced by fixing bug #690021.
Regards, Tim
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash
Versions of packages libc6:amd64 depends on:
ii libc-bin 2.13-36
ii libgcc1 1:4.7.2-4
libc6:amd64 recommends no packages.
Versions of packages libc6:amd64 suggests:
ii debconf [debconf-2.0] 1.5.46
ii glibc-doc 2.13-36
ii locales 2.13-36
ii locales-all [locales] 2.13-36
-- debconf information excluded
Reply to: