summaryrefslogtreecommitdiff
path: root/net-misc/ntp/files/ntp-4.2.8_p18-r2-bind-fail-NULL-dereference.patch
blob: eb05560d57ed77f08e613180b52fe5a623605697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Patch supplied by Nick Bowler on https://bugs.gentoo.org/962770

This avoids a NULL dereference in case ntp fails to bind() to a decided upon
address that should be bound.
--- ntp-4.2.8p18/ntpd/ntp_io.c.orig
+++ ntp-4.2.8p18/ntpd/ntp_io.c
@@ -1921,11 +1921,11 @@
 		}
 		else {
 			DPRINT_INTERFACE(3,
-				(ep, "updating ", " new - FAILED"));
+				(ep2, "updating ", " new - FAILED"));
 
 			msyslog(LOG_ERR,
 				"cannot bind address %s",
-				stoa(&ep->sin));
+				stoa(&ep2->sin));
 		}
 		free(ep2);
 	}