Backport upstream fix for CVE-2025-5278 (sort: heap buffer
under-read CWE-127) to coreutils-8.30. The fix adds proper
bounds-checked pointer arithmetic in sort's begfield_uni and
limfield_uni functions, replacing unsafe MIN(lim, ptr + offset)
with a remaining_bytes check. A new test case
(tests/misc/sort-field-limit.sh) is included.
CVE: CVE-2025-5278
Upstream patches:
- 8c9602e3a1.patch
Resolves: RHEL-216927
This commit was backported by Ymir, a Red Hat Enterprise Linux software maintenance AI agent.
Assisted-by: Ymir