Project
vgrep
Description
In search_tui.rs, the next() and previous() functions check self.results.is_empty() at the start but then access self.results.len() - 1. If results become empty between the check and access (in a theoretical multi-threaded scenario), this could cause underflow.
Error Message
Debug Logs
System Information
OS: Any
Rust Version: 1.75+
Screenshots
No response
Steps to Reproduce
- Open vgrep TUI
- Perform a search that returns results
- Navigate results while simultaneously triggering a new search that returns no results
Expected Behavior
Navigation should gracefully handle results changing during interaction
Actual Behavior
Potential race condition between results modification and navigation
Additional Context
No response
Project
vgrep
Description
In
search_tui.rs, thenext()andprevious()functions checkself.results.is_empty()at the start but then accessself.results.len() - 1. If results become empty between the check and access (in a theoretical multi-threaded scenario), this could cause underflow.Error Message
Debug Logs
System Information
Screenshots
No response
Steps to Reproduce
Expected Behavior
Navigation should gracefully handle results changing during interaction
Actual Behavior
Potential race condition between results modification and navigation
Additional Context
No response