[Git][NTPsec/ntpsec][master] Added NULL detector for pps_peer segfault.

Gary E. Miller gitlab at mg.gitlab.com
Fri Aug 31 22:33:08 UTC 2018


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
964e181b by Ian Bruene at 2018-08-31T22:33:03Z
Added NULL detector for pps_peer segfault.

- - - - -


1 changed file:

- ntpd/refclock_gpsd.c


Changes:

=====================================
ntpd/refclock_gpsd.c
=====================================
@@ -595,8 +595,11 @@ gpsd_shutdown(
 	if (up == NULL)
 		return;
 
-	/* now check if we must close IO resources */
-	if (pp != up->pps_peer->procptr) {
+	if (up->pps_peer == NULL) {
+		/* This is NULL if no related PPS */
+		DPRINT(1, ("%s: pps_peer found NULL", up->logname));
+	} else if (pp != up->pps_peer->procptr) {
+		/* now check if we must close IO resources */
 		if (-1 != pp->io.fd) {
 			DPRINT(1, ("%s: closing clock, fd=%d\n",
 				   up->logname, pp->io.fd));



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/964e181b3737e3511ad8494be235140ae9b19c0a

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/964e181b3737e3511ad8494be235140ae9b19c0a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180831/647e8098/attachment.html>


More information about the vc mailing list