[Git][NTPsec/ntpsec][master] Address GitLab issue #375: ntpd terminates unexpectedly

Eric S. Raymond gitlab at mg.gitlab.com
Wed Sep 6 02:21:16 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
aebeba5f by Eric S. Raymond at 2017-09-06T02:19:44+00:00
Address GitLab issue #375: ntpd terminates unexpectedly

It was already known that the AM_NEWPASS case could be hit during pool
processing.  Apparently AM_MANYCAST can too.  Now guarding all three
cases just to be on the safe side.

- - - - -


1 changed file:

- ntpd/ntp_proto.c


Changes:

=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -862,13 +862,15 @@ receive(
 		break;
 	    case AM_PROCPKT:
 		handle_procpkt(rbufp, restrict_mask, pkt, peer, authenticated);
-		sys_processed++;
+		if (peer != NULL)	/* just to be on the safe side */
+		    sys_processed++;
 		peer->processed++;
 		break;
 	    case AM_MANYCAST:
 		handle_manycast(rbufp, restrict_mask, pkt, peer, authenticated);
 		sys_processed++;
-		peer->processed++;
+		if (peer != NULL)	/* possible during pool query */
+		    peer->processed++;
 		break;
 	    default:
 		/* Everything else is for broadcast modes,



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/aebeba5faeaa81cfe4223854f09829a69f7eaa57
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/20170906/295519c6/attachment.html>


More information about the vc mailing list