This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Segfault in getifaddrs_internal in glibc-2.20
- From: Allan McRae <allan at archlinux dot org>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Sat, 13 Sep 2014 16:56:04 +1000
- Subject: Segfault in getifaddrs_internal in glibc-2.20
- Authentication-results: sourceware.org; auth=none
Hi,
An Arch Linux user has encountered a segfault in getifaddrs_internal:
https://sourceware.org/bugzilla/show_bug.cgi?id=17371
This patch is posted there:
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c
b/sysdeps/unix/sysv/linux/ifaddrs.c
index 2c04e17..1fa4960 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -774,7 +774,7 @@ getifaddrs_internal (struct ifaddrs **ifap)
unsigned int preflen;
if ((max_prefixlen > 0) &&
- (ifam->ifa_prefixlen > max_prefixlen))
+ (max_prefixlen > ifam->ifa_prefixlen))
preflen = max_prefixlen;
else
preflen = ifam->ifa_prefixlen;
This seems to fix the issue for them. After looking at the code for a
long time, I am still not sure if this is the correct fix. Can anyone
confirm/deny?
Thanks,
Allan