From 91b4b5393fe18d32505f967d482b81eef7f68d22 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 18 Mar 2021 00:34:22 +0200 Subject: 13650 sendmail: writing 1 byte into a region of size 0 Reviewed by: Andy Fiddaman Approved by: Dan McDonald --- usr/src/cmd/sendmail/src/daemon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/src/cmd/sendmail/src/daemon.c b/usr/src/cmd/sendmail/src/daemon.c index 983ad2fe3e..b048fc8ecf 100644 --- a/usr/src/cmd/sendmail/src/daemon.c +++ b/usr/src/cmd/sendmail/src/daemon.c @@ -4360,10 +4360,11 @@ anynet_ntoa(sap) (void) sm_snprintf(buf, sizeof(buf), "Family %d: ", sap->sa.sa_family); bp = &buf[strlen(buf)]; ap = sap->sa.sa_data; - for (l = sizeof(sap->sa.sa_data); --l >= 0; ) + for (l = sizeof(sap->sa.sa_data); --l >= 0 && SPACELEFT(buf, bp) > 3; ) { (void) sm_snprintf(bp, SPACELEFT(buf, bp), "%02x:", *ap++ & 0377); + bp += 3; } *--bp = '\0'; -- cgit v1.2.3