diff options
author | Rose <83477269+AtariDreams@users.noreply.github.com> | 2023-01-09 09:19:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 15:19:30 +0100 |
commit | 72fe9d30269cc69703c70260215be1f031589b02 (patch) | |
tree | 9421b0890fba03bd5f6ca9c515235bf5ec94ff71 | |
parent | 013aef1275899bcee0b394402673a949c33c72db (diff) | |
download | libarchive-72fe9d30269cc69703c70260215be1f031589b02.tar.gz |
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
-rw-r--r-- | libarchive/archive_read_support_format_cpio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c index 6b8ae33a..a4899144 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); |