Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Sep 26, 2024
1 parent 5248a2b commit 57b87aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/net/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn split_address(addr string) !(string, u16) {
// to validate ipv6 address sanity?

// RFC4038 - allow [::1]:port
if address[0] == `[` && address[address.len - 1] == `]` {
if address.len > 0 && address[0] == `[` && address[address.len - 1] == `]` {
address = address[1..address.len - 1]
}

Expand Down

0 comments on commit 57b87aa

Please sign in to comment.