Add PoC for assertion failure on large TCP DNS messages

(cherry picked from commit 2c796bb9c8)
This commit is contained in:
Ondřej Surý
2020-07-31 10:08:41 +02:00
parent 651a9fe4db
commit 9d3c6785b5
3 changed files with 9 additions and 0 deletions

View File

@@ -184,5 +184,13 @@ grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking that BIND 9 doesn't crash on long TCP messages ($n)"
ret=0
$PERL ../packet.pl -a "10.53.0.1" -p "${PORT}" -t udp 1996-alloc_dnsbuf-crash-test.pkt || ret=1
dig_with_opts +tcp @10.53.0.1 txt.example > dig.out.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1