Use checked addition and forward-progress guards in committed memory queries #455
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/455"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-11-29T18:19:30Z.
Problem
In crates/victory-gpu/src/texture.rs (committed_by_query) and crates/victory-gpu/src/port.rs (committed):
ext <= p /
ext <= here), and committed_by_query also uses unchecked BaseAddress as usize + RegionSize.
Fix
Use checked_add(len) (returning alse on overflow), saturating_add(info.RegionSize), and a
ext <= p /
ext <= here forward-progress guard in both functions, with unit tests (committed_by_query_rejects_overflowing_range and committed_rejects_overflowing_range).
Verification
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:09:18Z.
Thanks for guarding both the range end and the VirtualQuery loop's forward progress. Rejecting overflow before querying is the right behavior. Please retain normal committed/uncommitted range coverage as well as the new overflow cases; I haven't run the consolidated tests yet.
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:05:43Z.
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed