mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-04 15:02:04 +00:00
Kit: do not crash on [abcd::] with missing port
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d8568b0e31
commit
b67acaccff
@ -52,6 +52,7 @@ extension Endpoint {
|
||||
let startOfHost = string.index(after: string.startIndex)
|
||||
guard let endOfHost = string.dropFirst().firstIndex(of: "]") else { return nil }
|
||||
let afterEndOfHost = string.index(after: endOfHost)
|
||||
if afterEndOfHost == string.endIndex { return nil }
|
||||
guard string[afterEndOfHost] == ":" else { return nil }
|
||||
startOfPort = string.index(after: afterEndOfHost)
|
||||
hostString = String(string[startOfHost ..< endOfHost])
|
||||
|
Loading…
Reference in New Issue
Block a user