sendmail: writing 1 byte into a region of size 0
Build errors on SPARC with gcc 10:
daemon.c: In function 'anynet_ntoa': daemon.c:4369:8: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 4369 | *--bp = '\0'; | ~~~~~~^~~~~~ daemon.c:4314:14: note: at offset -1 to object 'buf' with size 100 declared here 4314 | static char buf; | ^~~ cc1: all warnings being treated as errors *** Error code 1 dmake: Fatal error: Command failed for target `daemon.o' Current working directory /code/illumos-gate/usr/src/cmd/sendmail/src
This error is trying to tell us, we have potential write past array end. I'm not exactly sure why we do not get this on x86 (gcc 10.1 on sparc and 10.2 on x86). Patch is result of iteration with upstream.
Testing done: build is ok.
Updated by Electric Monk about 1 year ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit 91b4b5393fe18d32505f967d482b81eef7f68d22 Author: Toomas Soome <firstname.lastname@example.org> Date: 2021-03-30T20:18:04.000Z 13650 sendmail: writing 1 byte into a region of size 0 Reviewed by: Andy Fiddaman <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>