]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fix NULL pointer dereference in archive_acl_from_text_w()
authorzhangjy1014 <60053759+zhangjy1014@users.noreply.github.com>
Sun, 8 Feb 2026 09:18:43 +0000 (17:18 +0800)
committerzhangjy1014 <60053759+zhangjy1014@users.noreply.github.com>
Sun, 8 Feb 2026 09:18:43 +0000 (17:18 +0800)
commit7a6549a6bf4bc4d14c1ae3de8aeba53a11d1faa7
tree4af24d9318435b1d53ed1cd3dedd1af8527a9266
parent8d1c9b95f1fbc68f3882ef859d6caf7b701fde7c
Fix NULL pointer dereference in archive_acl_from_text_w()

When parsing a short "default" ACL prefix (e.g. L"d") with no
subsequent tag field, field[n] is left as {NULL, NULL} and the
code dereferences it unconditionally in the switch statement,
causing a SEGV.

Add a zero-length check after computing the field length so that
malformed entries are skipped with ARCHIVE_WARN, matching the
documented contract. Also move the st pointer computation after
the guard to avoid dereferencing a NULL start pointer.

Fixes libarchive/libarchive#2744
libarchive/archive_acl.c