浏览代码

uClibc-0.9.30.1: fix possible NULL pointer dereference (closes #5242)

SVN-Revision: 16304
Gabor Juhos 16 年之前
父节点
当前提交
da4435f2e1

+ 11 - 0
toolchain/uClibc/patches-0.9.30.1/900-backport_fix_possible_null_ptr_dereference_in_getaddrinfo.patch

@@ -0,0 +1,11 @@
+--- a/libc/inet/getaddrinfo.c
++++ b/libc/inet/getaddrinfo.c
+@@ -187,6 +187,8 @@
+ 		}
+ 
+ 		for (runp = ifa; runp != NULL; runp = runp->ifa_next) {
++			if (runp->ifa_addr == NULL)
++				continue;
+ #if defined __UCLIBC_HAS_IPV4__
+ 			if (runp->ifa_addr->sa_family == PF_INET)
+ 				seen |= SEEN_IPV4;