From 8ddabb35b66992f9ffdada19cad52f28cedabeef Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 31 May 2024 15:50:34 +0300 Subject: [PATCH] Fix test for ports below zero and put port number to error message --- fastrpc.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastrpc.cgi b/fastrpc.cgi index 4c0e885ea..e570125e5 100755 --- a/fastrpc.cgi +++ b/fastrpc.cgi @@ -349,8 +349,8 @@ if ($fh6) { } while(1) { $$port++; - if ($$port >= 65536) { - return "Failed to allocate a free port!"; + if ($$port < 0 || $$port > 65535) { + return "Failed to allocate a free port number: $port"; } $pack = pack_sockaddr_in($$port, INADDR_ANY); next if (!bind($fh, $pack));