git: f340e3ff6c03 - main - net/ntp: Fix two segfaults

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Fri, 21 Nov 2025 04:02:59 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f340e3ff6c03de60564134af4f954d11888bd436

commit f340e3ff6c03de60564134af4f954d11888bd436
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2025-11-21 04:00:47 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-11-21 04:00:47 +0000

    net/ntp: Fix two segfaults
    
    Pull in src/628715fdcc9f and src/ac1f48b4a7be fixing two NULL pointer
    derefs.
    
    Obtained from:  src/628715fdcc9f and src/ac1f48b4a7be
    MFH:            2025Q4
---
 net/ntp/Makefile                   |  2 +-
 net/ntp/files/patch-ntpd_ntp__io.c | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/net/ntp/Makefile b/net/ntp/Makefile
index 2de4909c1769..4f858447eca4 100644
--- a/net/ntp/Makefile
+++ b/net/ntp/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ntp
 PORTVERSION=	4.2.8p18
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	net
 MASTER_SITES=	http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ \
 		http://archive.ntp.org/ntp4/ntp-4.2/
diff --git a/net/ntp/files/patch-ntpd_ntp__io.c b/net/ntp/files/patch-ntpd_ntp__io.c
index 10bac6d961f7..d43d090049ec 100644
--- a/net/ntp/files/patch-ntpd_ntp__io.c
+++ b/net/ntp/files/patch-ntpd_ntp__io.c
@@ -1,5 +1,5 @@
 --- ntpd/ntp_io.c.orig	2024-05-07 04:21:17.000000000 -0700
-+++ ntpd/ntp_io.c	2025-02-18 19:38:16.412031000 -0800
++++ ntpd/ntp_io.c	2025-11-20 19:55:01.228924000 -0800
 @@ -1486,9 +1486,7 @@
  
  	if (IS_IPV6(psau)) {
@@ -11,6 +11,20 @@
  			return TRUE;
  		}
  	} else if (IS_IPV4(psau)) {
+@@ -1921,11 +1919,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);
+ 	}
 @@ -3205,7 +3203,7 @@
  	}