Fix off-by-one in port number validation

This commit is contained in:
Cameron Gutman 2021-07-02 01:16:20 -05:00
parent 46887c0447
commit 0cd3fcf1be

View File

@ -547,7 +547,7 @@ static bool parseServerPortFromTransport(PRTSP_MESSAGE response, uint16_t* port)
// Validate the port number // Validate the port number
long int rawPort = strtol(portStart, NULL, 10); long int rawPort = strtol(portStart, NULL, 10);
if (rawPort <= 0 || rawPort >= 65535) { if (rawPort <= 0 || rawPort > 65535) {
return false; return false;
} }