zig/lib/std/sort
Frank Denis 6dd0270a19
std.sort.pdq: fix out-of-bounds access in partialInsertionSort (#25253)
* std.sort.pdq: fix out-of-bounds access in partialInsertionSort

When sorting a sub-range that doesn't start at index 0, the
partialInsertionSort function could access indices below the range
start. The loop condition `while (j >= 1)` didn't respect the
arbitrary range boundaries [a, b).

This changes the condition to `while (j > a)` to ensure indices
never go below the range start, fixing the issue where pdqContext
would access out-of-bounds indices.

Fixes #25250
2025-09-17 19:54:15 -07:00
..
block.zig
pdq.zig std.sort.pdq: fix out-of-bounds access in partialInsertionSort (#25253) 2025-09-17 19:54:15 -07:00