Repository navigation
Misc runtime safety fixes - #13275
Merged
Merged
Conversation
Low-level search state accepted an empty needle even though the search thread normally filters it out. SlidingWindow treated the empty string as a zero-length match and underflowed while calculating its inclusive end offset. Active and viewport overlap calculations could also underflow while loading adjacent pages. Treat an empty needle as an inactive search with no matches or history, and saturate the viewport overlap length.
Pin.leftWrap and rightWrap calculated the destination using the remainder after consuming the current row. When that remainder was an exact multiple of the column count, rightWrap subtracted one from zero and leftWrap produced a column equal to the width. Dereferencing either pin could panic. A maximum usize offset on a one-column page also overflowed the row count. Base the row and column calculations on the remainder minus one. This maps exact multiples to the final cell of the correct row and keeps the maximum offset calculation in range so traversal reports overflow normally.
setCursorPos added origin-mode margins to requested row and column values before clamping them to the scrolling region. A request near maxInt(usize) overflowed during that addition and crashed instead of landing on the region boundary. Use saturating addition for the origin offsets. The existing clamp then places oversized requests on the bottom-right margin without changing normal cursor positioning.
Contributor
Author
|
Nvm GPT shut me down for cybersecurity blocks. YO. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runtime safety violating scenarios found by GPT 5.6. Verified each one manually. See each commit.
I'm going to keep searching so not going to merge this yet.