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

thread 'main' panicked at 'range end index 27690 out of range for slice of length 10000' #1

Open
webnoob opened this issue May 24, 2023 · 1 comment

Comments

@webnoob
Copy link

webnoob commented May 24, 2023

Hi,

I'm getting the following error:

thread 'main' panicked at 'range end index 27690 out of range for slice of length 10000', C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\tasklist-0.2.12\src\infos\info.rs:393:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[0524/140042.139:ERROR:window_impl.cc(119)] Failed to unregister class Chrome_WidgetWin_0. Error = 0

when running:

#[cfg(windows)] {
        let tl = tasklist::Tasklist::new();
        for i in tl {
          let s = tasklist::get_proc_params(i.get_pid());
        }
}

(obviously a cut down version of my code). Commenting out let s = tasklist::get_proc_params(i.get_pid()); stops the panick.

I can see why the error happens, looking at the file:

let mut temp:[u16;10000] = [0;10000];

The array size is hardcoded and doesn't allow enough

@yalishandar
Copy link
Owner

Sorry, there are some flaws in the code. I will update these errors in my spare time. If you have copied these codes, you can also submit pr.

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

2 participants