[master] fix dig +ednsopt padding error

4556.	[bug]		Sending an EDNS Padding option using "dig
			+ednsopt" could cause a crash in dig. [RT #44462]
This commit is contained in:
Evan Hunt
2017-01-19 23:52:41 -08:00
parent 25a9b90369
commit 4f744a027f
5 changed files with 27 additions and 8 deletions

View File

@@ -107,5 +107,15 @@ if [ "$opad" -ne "$npad" ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:checking that zero-length padding option has no effect ($n)"
ret=0
n=`expr $n + 1`
$DIG +qr +ednsopt=12 foo.example @10.53.0.2 -p 5300 > dig.out.test$n.1
grep "; PAD" dig.out.test$n.1 > /dev/null || ret=1
$DIG +qr +ednsopt=12:00 foo.example @10.53.0.2 -p 5300 > dig.out.test$n.2
grep "; PAD" dig.out.test$n.2 > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1