Browse Source

Fix integer overflow in port allocation causing permanent allocation failure

Co-authored-by: ggarber <[email protected]>
copilot-swe-agent[bot] 3 tháng trước cách đây
mục cha
commit
0ca4649367
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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) {
 
-      if (tp->high <= tp->low) {
+      if ((tp->high - tp->low) == 0) {
         TURN_MUTEX_UNLOCK(&tp->mutex);
         return -1;
       }