diff options
| author | Ihar Hrachyshka <ihar.hrachyshka@gmail.com> | 2026-07-04 19:37:24 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-07-04 17:59:36 -0700 |
| commit | 1eb281159f0f75044e9e45a47d1d34162f3b0032 (patch) | |
| tree | d01c5395342bcc7de9e056b000f5666a167cef40 /gitweb/gitweb.css | |
| parent | 67ad42147a7acc2af6074753ebd03d904476118f (diff) | |
precompose_utf8: use a flex array for d_name
On macOS, git status may abort while reading a directory entry
whose UTF-8 name grows past NAME_MAX bytes:
__chk_fail_overflow
__strlcpy_chk
precompose_utf8_readdir
read_directory_recursive
wt_status_collect
cmd_status
The precompose wrapper already reallocates dirent_prec_psx for
long names, but d_name is declared as char[NAME_MAX + 1]. A
fortified libc can still see that declared object size and reject a
larger strlcpy bound, even though the allocation was grown.
Make d_name a FLEX_ARRAY and size allocations from offsetof(). That
matches the actual object layout with the dynamic allocation, so the
fortified copy sees a destination whose size can grow with max_name_len.
Add a regression test that creates an over-NAME_MAX non-ASCII basename
and runs status with core.precomposeunicode enabled.
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.css')
0 files changed, 0 insertions, 0 deletions
