0
0
mirror of https://github.com/libarchive/libarchive.git synced 2026-01-18 17:11:25 +01:00

Merge pull request #2831 from AZero13/check-copy-length

Use copy_length as upper-bound, not strlen(p)
This commit is contained in:
Tim Kientzle
2025-12-27 10:27:12 -08:00
committed by GitHub

View File

@@ -539,7 +539,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
ret = ARCHIVE_WARN;
}
if (copy_length > 0) {
if (strlen(p) > USTAR_gname_size) {
if (copy_length > USTAR_gname_size) {
if (tartype != 'x') {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC, "Group name too long");