Skip to content

Integer overflow when decoding a } #7

@finnbear

Description

@finnbear

I noticed the library panics on certain inputs containing }:

[dependencies]
base85 = "2.0.0"
fn main() {
    println!("{:?}", base85::decode("}"));
}
$ cargo run
thread 'main' panicked at 'attempt to multiply with overflow', /home/finnb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/base85-2.0.0/src/lib.rs:158:27

$ cargo run --release
Err(UnexpectedEof)

As far as I can tell, it is trying to compute 83*85^4=4332651875 which overflows u32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions