alloy-rs / rlp

Fast implementation of Ethereum RLP serialization
Apache License 2.0
86 stars 17 forks source link

fix: `Ip{,v4,v6}Addr::decode` #7

Closed DaniPopes closed 1 year ago

DaniPopes commented 1 year ago

Motivation

Ip addr decoding used static_left_pad, which fails if the buffer starts with a zero. This is incorrect and it also should not pad lower lengths

Solution

Use <[u8; N]>::try_from(&[u8])

PR Checklist