diff options
author | Sami Kerola | 2016-04-02 17:58:14 +0200 |
---|---|---|
committer | Karel Zak | 2016-04-13 12:29:16 +0200 |
commit | 962a7dc3b0372d718e1686a2d5734cbde4713cab (patch) | |
tree | 953916031b9311d022ab2d60814d8beb7dfe20c8 /tests/ts/colcrt | |
parent | libmount: try absolute target before canonicalize (diff) | |
download | kernel-qcow2-util-linux-962a7dc3b0372d718e1686a2d5734cbde4713cab.tar.gz kernel-qcow2-util-linux-962a7dc3b0372d718e1686a2d5734cbde4713cab.tar.xz kernel-qcow2-util-linux-962a7dc3b0372d718e1686a2d5734cbde4713cab.zip |
colcrt: avoid the command getting hung [afl]
Some inputs make getwc(3) not to progress file descriptor and neither to
report EILSEQ. Detect such situation and skip the bad input.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'tests/ts/colcrt')
-rw-r--r-- | tests/ts/colcrt/hang1 | 1 | ||||
-rwxr-xr-x | tests/ts/colcrt/regressions | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/ts/colcrt/hang1 b/tests/ts/colcrt/hang1 new file mode 100644 index 000000000..d26259e99 --- /dev/null +++ b/tests/ts/colcrt/hang1 @@ -0,0 +1 @@ +789:;<=>=>?IABUVNXYZ[_`abcdefgg !"#$%&'()*+,-./01234)*:,-./0123456789:;[=>?1234)*:,-./0123456789:;[=>?4456789:;<=>?IABUVN`abcdefg !" $%&'()*+,-./0123z{|ü~e
\ No newline at end of file diff --git a/tests/ts/colcrt/regressions b/tests/ts/colcrt/regressions index 067523f08..2ab751c36 100755 --- a/tests/ts/colcrt/regressions +++ b/tests/ts/colcrt/regressions @@ -23,12 +23,13 @@ ts_check_test_command "$TS_CMD_COLCRT" check_input_file() { ts_init_subtest ${1##*/} - $TS_CMD_COLCRT < $1 > $TS_OUTPUT 2>&1 + timeout 2 $TS_CMD_COLCRT < $1 > $TS_OUTPUT 2>&1 echo "return value: $?" >> $TS_OUTPUT ts_finalize_subtest } check_input_file "$TS_SELF/crash1" check_input_file "$TS_SELF/crash2" +check_input_file "$TS_SELF/hang1" ts_finalize |