mdnsresponder: Fix nullpointer dereference while parsing interface list
authorMaarten Aertsen <maarten@rtsn.nl>
Fri, 25 Feb 2022 20:46:53 +0000 (21:46 +0100)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Sun, 6 Mar 2022 12:08:52 +0000 (13:08 +0100)
This patch was backported from https://github.com/IETF-Hackathon/mDNSResponder/commit/1fb07b9524b4afed3a826c087db4dc48a7bfdb8

(cherry picked from commit a4b33ab169a3ca60cd12c2eb5155e899779d3570)
Signed-off-by: Maarten Aertsen <spam-github@rtsn.nl>
net/mdnsresponder/Makefile
net/mdnsresponder/patches/020-fix-core-dump-while-parsing-interface-list.patch [new file with mode: 0644]

index a46b53688f40d46a11c246a8501ad00d144b38e9..0c886f3ccb0bcd7fa660333460918e225cad8b0a 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mDNSResponder
 PKG_VERSION:=IETF104
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://opensource.apple.com/tarballs/mDNSResponder/IETF/
diff --git a/net/mdnsresponder/patches/020-fix-core-dump-while-parsing-interface-list.patch b/net/mdnsresponder/patches/020-fix-core-dump-while-parsing-interface-list.patch
new file mode 100644 (file)
index 0000000..d62cb7b
--- /dev/null
@@ -0,0 +1,18 @@
+From 1fb07b9524b4afed3a826c087db4dc48a7bfdb89 Mon Sep 17 00:00:00 2001
+From: Ted Lemon <elemon@apple.com>
+Date: Thu, 6 Jun 2019 13:35:43 -0400
+Subject: [PATCH] Fix core dump while parsing interface list on Posix
+
+---
+--- a/mDNSPosix/mDNSPosix.c
++++ b/mDNSPosix/mDNSPosix.c
+@@ -1320,7 +1320,8 @@ mDNSlocal int SetupInterfaceList(mDNS *c
+         struct ifaddrs *i = intfList;
+         while (i)
+         {
+-            if (     ((i->ifa_addr->sa_family == AF_INET)
++            if (     i->ifa_addr != NULL &&
++                     ((i->ifa_addr->sa_family == AF_INET)
+ #if HAVE_IPV6
+                       || (i->ifa_addr->sa_family == AF_INET6)
+ #endif