Browse Source

Fix integer overflow in port allocation causing permanent allocation failure

Co-authored-by: ggarber <[email protected]>
copilot-swe-agent[bot] 3 months ago
parent
commit
0ca4649367
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/apps/relay/turn_ports.c

+ 1 - 1
src/apps/relay/turn_ports.c

@@ -172,7 +172,7 @@ int turnports_allocate(turnports *tp) {
 
 
     while (1) {
     while (1) {
 
 
-      if (tp->high <= tp->low) {
+      if ((tp->high - tp->low) == 0) {
         TURN_MUTEX_UNLOCK(&tp->mutex);
         TURN_MUTEX_UNLOCK(&tp->mutex);
         return -1;
         return -1;
       }
       }