Skip to content

Commit

Permalink
fix: Reduce max random port on iOS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Lucas Leblow committed Apr 2, 2024
1 parent 1e50720 commit e4c3548
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mobile/ios/Quiet/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e4c3548

Please sign in to comment.