Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow on decoding long data #3

Open
akoptelov opened this issue Jan 14, 2021 · 0 comments
Open

Overflow on decoding long data #3

akoptelov opened this issue Jan 14, 2021 · 0 comments

Comments

@akoptelov
Copy link

Decoding of long data may lead to panic, e.g. 1111...111 (133 times) which is encoding of 133 zero bytes.

        let data = [0; 133];
        let encoded = data.to_base58();
        encoded.from_base58().unwrap();

Debug build reports attempt to subtract with overflow, while Release issues range start index 18446744073709551615 out of range for slice of length 132.

It is mentioned here that this works only for data up to 128 bytes, but probably it should be stated more clearly and handled via Result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant