[Git][NTPsec/ntpsec][issue890] ntpd/refclock_zyfer.c: Fix off-by-one in aa18b3a68815a

Gary E. Miller (@garyedmundsmiller) gitlab at mg.gitlab.com
Sat Jul 18 02:06:05 UTC 2026



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


Commits:
7737b052 by Gary E. Miller at 2026-07-17T19:05:26-07:00
ntpd/refclock_zyfer.c: Fix off-by-one in aa18b3a68815a

- - - - -


1 changed file:

- ntpd/refclock_zyfer.c


Changes:

=====================================
ntpd/refclock_zyfer.c
=====================================
@@ -210,7 +210,8 @@ zyfer_receive(
 		else
 			return;
 	} else {
-		if (rbufp->recv_length >= (size_t)(BMAX - pp->lencode)) {
+                size_t avail = sizeof(p->a_lastcode) - (1 + pp->lencode);
+		if (rbufp->recv_length >= avail) {
 			pp->lencode = 0;
 			refclock_report(peer, CEVNT_BADREPLY);
 			return;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/7737b052568463c28402de1199e07fb0eebc1e00

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/7737b052568463c28402de1199e07fb0eebc1e00
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20260718/e3125d60/attachment.htm>


More information about the vc mailing list