mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-07 07:23:06 +00:00
fix zone validator
(bug caught by fuzzer)
This commit is contained in:
parent
877fe6538c
commit
faf8963c9a
@ -73,6 +73,9 @@ func ip6zoneBtS(b []byte) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ip6zoneVal(b []byte) error {
|
func ip6zoneVal(b []byte) error {
|
||||||
|
if len(b) == 0 {
|
||||||
|
return fmt.Errorf("invalid length (should be > 0)")
|
||||||
|
}
|
||||||
// Not supported as this would break multiaddrs.
|
// Not supported as this would break multiaddrs.
|
||||||
if bytes.IndexByte(b, '/') >= 0 {
|
if bytes.IndexByte(b, '/') >= 0 {
|
||||||
return fmt.Errorf("IPv6 zone ID contains '/': %s", string(b))
|
return fmt.Errorf("IPv6 zone ID contains '/': %s", string(b))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user