Commit defa4e5
committed
fix(android): clamp imported socksPort to non-privileged range 1024-65535
Android (Unix) reserves ports 1-1023 as privileged: a regular app
cannot bind to them without root. The previous coerceIn(1, 65535)
still allowed privileged ports through, which would fail at bind
time on non-rooted devices.
Tighten the clamp to coerceIn(1024, 65535). Update the test to
cover three boundary cases: above 65535 -> 65535, below 1024 -> 1024,
and a privileged port (80) -> 1024.1 parent fd42b2f commit defa4e5
2 files changed
Lines changed: 7 additions & 4 deletions
File tree
- android/app/src
- main/java/com/gooserelay/gooserelayvpn/ui/profiles
- test/java/com/gooserelay/gooserelayvpn
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
0 commit comments