From e4c35489c1f4b167c12704146ee5f6f9bdff71bf Mon Sep 17 00:00:00 2001 From: Lucas Leblow Date: Tue, 2 Apr 2024 14:28:12 -0700 Subject: [PATCH] fix: Reduce max random port on iOS I received an error `Fatal error: Range requires lowerBound <= upperBound` referencing the `FindFreePort.getFirstStartingFrom` method... apparently the port parameter for that function needs to be less than or equal to 65000. --- packages/mobile/ios/Quiet/AppDelegate.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mobile/ios/Quiet/AppDelegate.m b/packages/mobile/ios/Quiet/AppDelegate.m index 733bdcc4b2..cb92136270 100644 --- a/packages/mobile/ios/Quiet/AppDelegate.m +++ b/packages/mobile/ios/Quiet/AppDelegate.m @@ -73,9 +73,9 @@ - (void) spinupBackend:(BOOL)init { self.dataPort = [findFreePort getFirstStartingFromPort:11000]; - uint16_t socksPort = [findFreePort getFirstStartingFromPort:arc4random_uniform(65535 - 1024) + 1024]; - uint16_t controlPort = [findFreePort getFirstStartingFromPort:arc4random_uniform(65535 - 1024) + 1024]; - uint16_t httpTunnelPort = [findFreePort getFirstStartingFromPort:arc4random_uniform(65535 - 1024) + 1024]; + uint16_t socksPort = [findFreePort getFirstStartingFromPort:arc4random_uniform(65000 - 1024) + 1024]; + uint16_t controlPort = [findFreePort getFirstStartingFromPort:arc4random_uniform(65000 - 1024) + 1024]; + uint16_t httpTunnelPort = [findFreePort getFirstStartingFromPort:arc4random_uniform(65000 - 1024) + 1024]; // (2/6) Spawn tor with proper configuration