diff options
| author | Frank Denis <124872+jedisct1@users.noreply.github.com> | 2025-09-18 04:54:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-17 19:54:15 -0700 |
| commit | 6dd0270a1926661e339d993a825fffa82be6bd51 (patch) | |
| tree | 6f7e7cfa8f35001fea399408cfa39b91c96ee1c9 /lib/std/Random | |
| parent | 4314c9653a874451d1c9b3dbb8be08d966344028 (diff) | |
| download | zig-6dd0270a1926661e339d993a825fffa82be6bd51.tar.gz zig-6dd0270a1926661e339d993a825fffa82be6bd51.zip | |
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
Diffstat (limited to 'lib/std/Random')
0 files changed, 0 insertions, 0 deletions
