PumpkinSeed / eip55-rs

Rust implementation of EIP-55
MIT License
3 stars 2 forks source link

Out-of-bounds read #7

Closed Lohann closed 1 year ago

Lohann commented 1 year ago

Steps to reproduce

eip55::validate_address("Îñţérñåţîöñåļîžåţîờñ");

Panics with:

byte index 1 is not a char boundary; it is inside 'Î' (bytes 0..2) of `Îñţérñåţîöñåļîžåţîờñ`
thread 'project::test::check_invalid_addresses' panicked at 'byte index 1 is not a char boundary; it is inside 'Î' (bytes 0..2) of `Îñţérñåţîöñåļîžåţîờñ`'

I'm using the latest version:

eip55 = "0.3"
Lohann commented 1 year ago

Actually any invalid string make it panic..

Lohann commented 1 year ago

Also empty is considered a valid address:

assert!(eip55::validate_address(""));
PumpkinSeed commented 1 year ago

Thanks for the report, I will try to have a PR for that in next week.