You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnmain(){// let filepath = input file in the ziplet data = std::fs::read(filepath).unwrap();ifletOk(vm) = rbpf::EbpfVmNoData::new(Some(&data)){
vm.execute_program();}}
Output
thread 'main' panicked at 'attempt to add with overflow', /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/rbpf-0.1.0/src/lib.rs:583:45
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::panicking::panic
9: rbpf::EbpfVmMbuff::check_mem
at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/rbpf-0.1.0/src/lib.rs:583
10: rbpf::EbpfVmMbuff::execute_program::{{closure}}
at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/rbpf-0.1.0/src/lib.rs:301
11: rbpf::EbpfVmMbuff::execute_program
at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/rbpf-0.1.0/src/lib.rs:372
12: rbpf::EbpfVmRaw::execute_program
at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/rbpf-0.1.0/src/lib.rs:1257
13: rbpf::EbpfVmNoData::execute_program
at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/rbpf-0.1.0/src/lib.rs:1540
Expect
properly return error instead of panic
The text was updated successfully, but these errors were encountered:
fn main() {
// let filepath = input file in the zip
let data = std::fs::read(filepath).unwrap();
if let Ok(vm) = rbpf::EbpfVmNoData::new(Some(&data)) {
Ok(vm) => data,
Err(err) => {
println!("{}", err);
break;
}
vm.execute_program();
}
}
//?
Input
in.zip
Code
Output
Expect
properly return error instead of panic
The text was updated successfully, but these errors were encountered: