summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2021-03-18 00:34:22 +0200
committerToomas Soome <tsoome@me.com>2021-03-30 23:18:04 +0300
commit91b4b5393fe18d32505f967d482b81eef7f68d22 (patch)
treef2f3f3c6750f23cb8f39f1d608497c61593b030c
parented0a9ca2a3cceedc0e6e889472de1cec55ca2faf (diff)
downloadillumos-joyent-91b4b5393fe18d32505f967d482b81eef7f68d22.tar.gz
13650 sendmail: writing 1 byte into a region of size 0
Reviewed by: Andy Fiddaman <andy@omnios.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/sendmail/src/daemon.c3
1 files changed, 2 insertions, 1 deletions
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';