fayez-nazzal / mouse_position

Rust crate to get mouse position on Linux, MacOS, and Windows.
https://crates.io/crates/mouse_position
MIT License
9 stars 6 forks source link

Read of null pointer #4

Open riking opened 9 months ago

riking commented 9 months ago

https://asan.saethlin.dev/ub?crate=mouse_position&version=0.1.3

running 1 test
test src/lib.rs - (line 4) ... FAILED

failures:

---- src/lib.rs - (line 4) stdout ----
Test executable failed (exit status: 1).

stderr:
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3426==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000000e0 (pc 0x7f43908e0b14 bp 0x7ffefbc726b0 sp 0x7ffefbc72558 T0)
==3426==The signal is caused by a READ memory access.
==3426==Hint: address points to the zero page.
    #0 0x7f43908e0b14 in XDefaultScreen (/lib/x86_64-linux-gnu/libX11.so.6+0x29b14) (BuildId: d1d3345a252a40a004cbd02011a651930e172ccd)
    #1 0x56342cae499a in mouse_position::impl_linux::_$LT$impl$u20$mouse_position..mouse_position..Mouse$GT$::get_mouse_position::h5df19bc7217182e2 /build/src/impl_linux.rs:15:31
    #2 0x56342cae3cfe in rust_out::main::h3c365c6a42822ba3 /build/src/lib.rs:7:20
    #3 0x56342cae3b22 in core::ops::function::FnOnce::call_once::hd97e66983c8afdf3 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
    #4 0x56342cae2be0 in std::sys_common::backtrace::__rust_begin_short_backtrace::h16f4d33891122c12 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:154:18