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

Integer underflow in clamp_scroll #63

Open
sternenseemann opened this issue Dec 16, 2024 · 1 comment
Open

Integer underflow in clamp_scroll #63

sternenseemann opened this issue Dec 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sternenseemann
Copy link
Contributor

sternenseemann commented Dec 16, 2024

Describe the bug

When moving beyond the screen space with the arrow keys in the debug build, it crashes due to an integer underflow. The release build behaves as expected (presumably because the check is not emitted).

To Reproduce

> base64 -w 0 /dev/zero | head -c 200 > test
> ./target/release/ad test
# Move to the end of the line, no problem
> env RUST_BACKTRACE=1 ./target/debug/ad test
Fatal error:
panicked at src/ui/layout.rs:796:28:
attempt to subtract with overflow

Versions & OS Details

  • Linux NixOS/unstable
  • ad Version f2e781c
@sternenseemann sternenseemann added the bug Something isn't working label Dec 16, 2024
@sminez
Copy link
Owner

sminez commented Dec 19, 2024

With the recent changes merged in #58 this no longer panics but the highlighting behaviour for selections isn't correct so that needs addressing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants