zig/lib/std/sort
Frank Denis 91eab35e08
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-18 12:47:18 +02:00
..
block.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
pdq.zig std.sort.pdq: fix out-of-bounds access in partialInsertionSort (#25253) 2025-09-18 12:47:18 +02:00