From: Tim Kientzle Date: Sat, 27 Dec 2025 18:27:12 +0000 (-0800) Subject: Merge pull request #2831 from AZero13/check-copy-length X-Git-Tag: v3.8.5~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7289ed54376f3547187ff017015d2a6562f14d4d;p=thirdparty%2Flibarchive.git Merge pull request #2831 from AZero13/check-copy-length Use copy_length as upper-bound, not strlen(p) (cherry picked from commit 782cdd88b6e5da4d2c023662c790837fc5f5c1af) --- diff --git a/libarchive/archive_write_set_format_ustar.c b/libarchive/archive_write_set_format_ustar.c index 09b71fe66..4084eb455 100644 --- a/libarchive/archive_write_set_format_ustar.c +++ b/libarchive/archive_write_set_format_ustar.c @@ -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");