From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Mon, 9 Jan 2023 14:19:30 +0000 (-0500) Subject: Do not account for NULL terminator when comparing with "TRAILER!!!" (#1814) X-Git-Tag: v3.7.0~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72fe9d30269cc69703c70260215be1f031589b02;p=thirdparty%2Flibarchive.git Do not account for NULL terminator when comparing with "TRAILER!!!" (#1814) Because at that point, you may as well replace the whole thing with strcmp --- diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c index 6b8ae33a4..a48991449 100644 --- a/libarchive/archive_read_support_format_cpio.c +++ b/libarchive/archive_read_support_format_cpio.c @@ -441,7 +441,7 @@ archive_read_format_cpio_read_header(struct archive_read *a, /* Compare name to "TRAILER!!!" to test for end-of-archive. */ if (namelength == 11 && strncmp((const char *)h, "TRAILER!!!", - 11) == 0) { + 10) == 0) { /* TODO: Store file location of start of block. */ archive_clear_error(&a->archive); return (ARCHIVE_EOF);