jblondin / csv-sniffer

CSV sniffer crate for Rust
MIT License
7 stars 1 forks source link

Out of bounds panic #19

Open HalfVoxel opened 1 year ago

HalfVoxel commented 1 year ago

I don't know which file caused this, but in our server logs we found this out of bounds panic from sniffer:

thread 'tokio-runtime-worker' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/csv-sniffer-0.3.1/src/sniffer.rs:282:54:
index out of bounds: the len is 0 but the index is 18446744073709551615
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/sr
c/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/s
rc/panicking.rs:67:14
   2: core::panicking::panic_bounds_check
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/s
rc/panicking.rs:162:5
   3: csv_sniffer::sniffer::Sniffer::run_chains
   4: csv_sniffer::sniffer::Sniffer::open_reader

I hope the stack trace is helpful enough to figure it out.