From 0cd3fcf1bec9444e4c29ef32371c6fa4884cdbb8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 2 Jul 2021 01:16:20 -0500 Subject: [PATCH] Fix off-by-one in port number validation --- src/RtspConnection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RtspConnection.c b/src/RtspConnection.c index a4bb8e1..844d6b2 100644 --- a/src/RtspConnection.c +++ b/src/RtspConnection.c @@ -547,7 +547,7 @@ static bool parseServerPortFromTransport(PRTSP_MESSAGE response, uint16_t* port) // Validate the port number long int rawPort = strtol(portStart, NULL, 10); - if (rawPort <= 0 || rawPort >= 65535) { + if (rawPort <= 0 || rawPort > 65535) { return false; }