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

Glob panicked because of an out-of-bounds error on the pattern #134

Open
ClementNerma opened this issue Nov 27, 2023 · 0 comments
Open

Glob panicked because of an out-of-bounds error on the pattern #134

ClementNerma opened this issue Nov 27, 2023 · 0 comments

Comments

@ClementNerma
Copy link

ClementNerma commented Nov 27, 2023

I tried to use a pretty basic pattern, and got the following crash (ran with RUST_BACKTRACE=1):

thread 'main' panicked at C:\Users\cleme\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glob-0.3.1\src\lib.rs:218:32:
byte index 14 is out of bounds of `\\*.custom*\*`
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\std\src\panicking.rs:597
   1: core::panicking::panic_fmt
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\core\src\panicking.rs:72
   2: core::fmt::Arguments::new_v1
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\core\src\fmt\mod.rs:331
   3: core::str::slice_error_fail_rt
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\core\src\str\mod.rs:110
   4: core::str::slice_error_fail
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library\core\src\str\mod.rs:87
   5: core::str::traits::impl$9::index
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962\library\core\src\str\traits.rs:361
   6: core::str::traits::impl$4::index<core::ops::range::RangeTo<usize> >
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962\library\core\src\str\traits.rs:61
   7: glob::glob_with
             at C:\Users\cleme\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glob-0.3.1\src\lib.rs:218
   8: <a call from my own crate>

Context:

  • Glob v0.3.1
  • Windows 11 23H2 (not WSL)
  • CWD on D: drive (not C:)
  • Rust v1.74.0

EDIT: Problem doesn't appear when I use \*.custom*\* instead of \\*.custom*\* (removing one of the lead backslashes)

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