mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
eb398971bf
add length check to detect array modification during sort. when realloc() shrinks an array in-place, it may return the same pointer, defeating the pointer-only check. the new check catches both pointer changes and length changes, preventing out-of-bounds access. the fix captures array pointer and length at the start of each comparison, then validates both after user code executes. this detects modifications even when realloc() returns the original pointer. Co-authored-by: Claude <noreply@anthropic.com>