[gnutls-devel] GnuTLS | tests suite portfinding endless loop (#1315)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Sun Jan 23 08:49:00 CET 2022
Andreas Metzler created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1315
Hello,
I have just managed to trigger an endless loop in the testsuite:
~~~
Checking with non-approved DH params: rfc5054-3072
unreserved port 50626
unreserved port 50626
unreserved port 50626
[...]
~~~
Looking at (tests/scripts/common.sh#L87) there seems to be a logic error:
~~~sh
GETPORT='
rc=0
unset myrandom
while test $rc = 0; do
if test -n "$RANDOM"; then myrandom=$(($RANDOM + $RANDOM)); fi
if test -z "$myrandom"; then myrandom=$(date +%N | sed s/^0*//); fi
if test -z "$myrandom"; then myrandom=0; fi
PORT="$(((($$<<15)|$myrandom) % 63001 + 2000))"
check_if_port_in_use $PORT;rc=$?
done
'
~~~
IF $RANDOM is not available myrandom never changes in the loop. Moving ```unset myrandom``` inside the loop should work. - Will post a merge request later.
cu Andreas
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1315
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20220123/aa6a74d5/attachment.html>
More information about the Gnutls-devel
mailing list