summaryrefslogtreecommitdiff
path: root/community/bsd-games/null-check.diff
diff options
context:
space:
mode:
Diffstat (limited to 'community/bsd-games/null-check.diff')
-rw-r--r--community/bsd-games/null-check.diff24
1 files changed, 24 insertions, 0 deletions
diff --git a/community/bsd-games/null-check.diff b/community/bsd-games/null-check.diff
new file mode 100644
index 000000000..048ed93f4
--- /dev/null
+++ b/community/bsd-games/null-check.diff
@@ -0,0 +1,24 @@
+diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c
+index 11f4c44..28321bc 100644
+--- a/hunt/hunt/hunt.c
++++ b/hunt/hunt/hunt.c
+@@ -394,7 +394,8 @@ broadcast_vec(s, vector)
+
+ vec_cnt = 0;
+ for (ip = ifp; ip; ip = ip->ifa_next)
+- if ((ip->ifa_addr->sa_family == AF_INET) &&
++ if (ip->ifa_addr &&
++ (ip->ifa_addr->sa_family == AF_INET) &&
+ (ip->ifa_flags & IFF_BROADCAST))
+ vec_cnt++;
+
+@@ -405,7 +406,8 @@ broadcast_vec(s, vector)
+
+ vec_cnt = 0;
+ for (ip = ifp; ip; ip = ip->ifa_next)
+- if ((ip->ifa_addr->sa_family == AF_INET) &&
++ if (ip->ifa_addr &&
++ (ip->ifa_addr->sa_family == AF_INET) &&
+ (ip->ifa_flags & IFF_BROADCAST))
+ memcpy(&(*vector)[vec_cnt++], ip->ifa_broadaddr,
+ sizeof(struct sockaddr_in));