You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The panic happens in hex.Decode if the submitted public key cannot fit in 32 bytes.
Should return an error instead.
func unmarshalHex(dst []byte, prefix string, data []byte) error {
n, err := hex.Decode(dst, bytes.TrimPrefix(data, []byte(prefix+":")))
if n < len(dst) {
err = io.ErrUnexpectedEOF
}
if err != nil {
return fmt.Errorf("decoding %v:<hex> failed: %w", prefix, err)
}
return nil
}
The text was updated successfully, but these errors were encountered:
mike76-dev
changed the title
unmarshalHex() panics if the submitted public key has more than 64 hex digits
unmarshalHex() panics if the public key submitted to UnmarshalText() has more than 64 hex digits
May 19, 2024
The panic happens in
hex.Decode
if the submitted public key cannot fit in 32 bytes.Should return an error instead.
The text was updated successfully, but these errors were encountered: