From: Stuart Henderson Subject: Re: [UPDATE} comms/hyl;afax 6.0.6 to 7.0.11 To: Larry Moore Cc: OpenBSD Ports Date: Wed, 25 Mar 2026 15:55:16 +0000 On 2026/03/25 15:46, Stuart Henderson wrote: > There are some things I'm not too sure about but will be easier to work > with smaller diffs for that I don't see how these cmdlen-related changes can do anything, - cmdlen++; /* Include NUL character */ + if (cmdlen > 0) cmdlen++; /* Include NUL character */ they're all snprintf to a static buffer and all have a non empty format string, so doesn't seem it can ever be hit. I think removing would make sense, do you agree? Index: Makefile =================================================================== RCS file: /cvs/ports/comms/hylafax/Makefile,v diff -u -p -r1.92 Makefile --- Makefile 25 Mar 2026 15:47:01 -0000 1.92 +++ Makefile 25 Mar 2026 15:53:07 -0000 @@ -1,6 +1,7 @@ COMMENT= send/receive faxes and share modems DISTNAME= hylafax-7.0.11 +REVISION= 0 CATEGORIES= comms HOMEPAGE= https://hylafax.sourceforge.io/ Index: patches/patch-util_faxconfig_c =================================================================== RCS file: patches/patch-util_faxconfig_c diff -N patches/patch-util_faxconfig_c --- patches/patch-util_faxconfig_c 25 Mar 2026 15:47:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: util/faxconfig.c ---- util/faxconfig.c.orig -+++ util/faxconfig.c -@@ -128,7 +128,7 @@ main(int argc, char** argv) - cmdlen = snprintf(cmd, cmdsize, "C%s%s:%s", - isQueuer ? ":" : "", argv[optind], argv[optind+1]); - } -- cmdlen++; /* Include NUL character */ -+ if (cmdlen > 0) cmdlen++; /* Include NUL character */ - if (cmdlen < 1 || cmdlen > cmdsize || write(fifo, cmd, cmdlen) != cmdlen) { - fatal("%s: FIFO write failed for command (%s)", - argv[0], strerror(errno)); Index: patches/patch-util_faxmodem_c =================================================================== RCS file: patches/patch-util_faxmodem_c diff -N patches/patch-util_faxmodem_c --- patches/patch-util_faxmodem_c 25 Mar 2026 15:47:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: util/faxmodem.c ---- util/faxmodem.c.orig -+++ util/faxmodem.c -@@ -315,7 +315,7 @@ main(int argc, char** argv) - } else { - cmdlen = snprintf(cmd, sizeof(cmd), "+%s:R%c%08x", devname, canpoll, caps); - } -- cmdlen++; /* Include NUL character */ -+ if (cmdlen > 0) cmdlen++; /* Include NUL character */ - if (cmdlen < 1 || cmdlen > sizeof(cmd) || write(fifo, cmd, cmdlen) != cmdlen) { - fatal("%s: FIFO write failed for command (%s)", - argv[0], strerror(errno)); Index: patches/patch-util_faxmsg_c =================================================================== RCS file: patches/patch-util_faxmsg_c diff -N patches/patch-util_faxmsg_c --- patches/patch-util_faxmsg_c 25 Mar 2026 15:47:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: util/faxmsg.c ---- util/faxmsg.c.orig -+++ util/faxmsg.c -@@ -147,7 +147,7 @@ main(int argc, char** argv) - fatal("%s: open: %s", fifoname, strerror(errno)); - } - cmdlen = snprintf(cmd, sizeof(cmd), cmdfmt, arg); -- cmdlen++; /* Include NUL character */ -+ if (cmdlen > 0) cmdlen++; /* Include NUL character */ - if (cmdlen < 1 || cmdlen > sizeof(cmd) || write(fifo, cmd, cmdlen) != cmdlen) { - fatal("FIFO write failed for command (%s)", strerror(errno)); - } Index: patches/patch-util_faxstate_c =================================================================== RCS file: patches/patch-util_faxstate_c diff -N patches/patch-util_faxstate_c --- patches/patch-util_faxstate_c 25 Mar 2026 15:47:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: util/faxstate.c ---- util/faxstate.c.orig -+++ util/faxstate.c -@@ -147,7 +147,7 @@ main(int argc, char** argv) - fatal("%s: open: %s", fifoname, strerror(errno)); - } - cmdlen = snprintf(cmd, sizeof(cmd), "S%s", arg); -- cmdlen++; /* Include NUL character */ -+ if (cmdlen > 0) cmdlen++; /* Include NUL character */ - if (cmdlen < 1 || cmdlen >= sizeof(cmd) || write(fifo, cmd, cmdlen) != cmdlen) { - fatal("FIFO write failed for command (%s)", strerror(errno)); - }