TL;DR: Fix scans that read outside their requested range or miss a match at the end.
Scan passes the full memory-region size even when starting inside the region and checks the upper bound too late. FindPattern also skips exact-length/final-position matches and underflows when the pattern is longer than the range.
Proposed change: Clip scans to the requested readable range, handle short and final-position cases, and skip guarded pages using the existing scanner.
Status / review: A native regression harness reproduces the old upper-bound failure. PR #16 combines this fix with an optional new unique-match API, which is on hold. The range correction has an independent justification and should be reviewed separately from that API expansion.
TL;DR: Fix scans that read outside their requested range or miss a match at the end.
Scanpasses the full memory-region size even when starting inside the region and checks the upper bound too late.FindPatternalso skips exact-length/final-position matches and underflows when the pattern is longer than the range.Proposed change: Clip scans to the requested readable range, handle short and final-position cases, and skip guarded pages using the existing scanner.
Status / review: A native regression harness reproduces the old upper-bound failure. PR #16 combines this fix with an optional new unique-match API, which is on hold. The range correction has an independent justification and should be reviewed separately from that API expansion.