]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Do not account for NULL terminator when comparing with "TRAILER!!!" (#1814)
authorRose <83477269+AtariDreams@users.noreply.github.com>
Mon, 9 Jan 2023 14:19:30 +0000 (09:19 -0500)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2023 14:19:30 +0000 (15:19 +0100)
Because at that point, you may as well replace the whole thing with
strcmp

libarchive/archive_read_support_format_cpio.c

index 6b8ae33a480b74b5c7f4e9340fcf9c11abeede8e..a4899144965c2e2a4ef6877422e64ea7bea36c22 100644 (file)
@@ -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);