tests: Check for infinite recursion ftp crash

* tests/Makefile.am (EXTRA_DIST): Add new binary fuzzer found input.
* tests/crash-ftp-msg2021-12_05.bin: New file.  Input found via
fuzzer that crashes ftp via infinite macro recursion.  Reported by AiDai in
<https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00005.html>.
* tests/ftp-regressions.sh: Add currently failing check for regression
of upcoming fix for bug reported by AiDai.
This commit is contained in:
Erik Auerswald
2022-10-02 16:47:48 +02:00
parent ef17ae467e
commit 9007083f26
3 changed files with 29 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ LDADD = $(iu_LIBRARIES)
EXTRA_DIST = tools.sh.in ifconfig_modes.sh crash-tftp-msg2021-12_18.bin \
crash-ftp-msg2021-12_03.bin crash-ftp-msg2021-12_16.bin \
crash-ftp-msg2021-12_04.bin
crash-ftp-msg2021-12_04.bin crash-ftp-msg2021-12_05.bin
noinst_PROGRAMS = identify
identify_LDADD = $(top_builddir)/lib/libgnu.a $(LIBUTIL) $(PTY_LIB)

Binary file not shown.

View File

@@ -105,6 +105,34 @@ else
$silence echo 'Input from message 2021-12/04 did not crash ftp.' >&2
fi
# Check regression of crash reported in:
# https://lists.gnu.org/archive/html/bug-inetutils/2021-12/msg00005.html
EFFORTS=`expr $EFFORTS + 1`
$silence echo 'Checking ftp crash bug from message 2021-12/05...' >&2
"$FTP" < "$srcdir"/crash-ftp-msg2021-12_05.bin >/dev/null 2>&1
if test $? -ne 0; then
$silence echo 'Regression of ftp crash bug from message 2021-12/05.' >&2
RESULT=1
else
SUCCESSES=`expr $SUCCESSES + 1`
$silence echo 'Input from message 2021-12/05 did not crash ftp.' >&2
fi
# Check trivial infinite macro recursion, too.
EFFORTS=`expr $EFFORTS + 1`
$silence echo 'Checking ftp crash via infinite macro recursion...' >&2
tell='macdef X
$ X
$ X'
echo "$tell" | "$FTP" >/dev/null 2>&1
if test $? -ne 0; then
$silence echo 'Regression of infinite macro recursion crash bug in ftp.' >&2
RESULT=1
else
SUCCESSES=`expr $SUCCESSES + 1`
$silence echo 'Infinite macro recursion did not crash ftp.' >&2
fi
# Print test statistics.
$silence echo
test "$RESULT" -eq 0 && test "$SUCCESSES" -eq "$EFFORTS" && $silence false \