Hi!

While updating inetutils to 2.8 in pkgsrc while using NetBSD
11.99.5/x86_64 I noticed two test failures:

FAIL: tftp-regressions.sh
FAIL: ftp-regressions.sh

>From test-suite.log:

FAIL: tftp-regressions.sh
=========================

[1]   Segmentation fault (core dumped) "${TFTP}" 
<${srcdir}/crash-tftp-msg2021-12_18....
Test had 0 successes out of 1 cases.
FAIL tftp-regressions.sh (exit status: 1)

FAIL: ftp-regressions.sh
========================

[1]   Segmentation fault (core dumped) "${FTP}" 
<"${srcdir}"/crash-ftp-msg2021-12_04....
Test had 5 successes out of 6 cases.
FAIL ftp-regressions.sh (exit status: 1)


The core dumps are:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000000034cc7e in makeargv () at tftp.c:927
927           while (*cp != '\0' && !isspace (*cp))


Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000faf4c6 in setnmap (argc=<optimized out>, argv=<optimized out>) 
at cmds.c:2288
2288      while (*cp && !isblank (*cp))

The problem is that the ctype(3) API per POSIX only allows int
arguments in the range of 'unsigned char' or EOF, and NetBSD is very
picky about this.

The arguments should be verified to be in the proper range and then
cast to 'unsigned char'. See e.g. https://man.netbsd.org/ctype.3

Cheers,
 Thomas

Reply via email to