diff options
Diffstat (limited to 'archival/libarchive/get_header_tar.c')
-rw-r--r-- | archival/libarchive/get_header_tar.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c index 0c663fbd7..2dbcdb50c 100644 --- a/archival/libarchive/get_header_tar.c +++ b/archival/libarchive/get_header_tar.c | |||
@@ -105,7 +105,7 @@ static void process_pax_hdr(archive_handle_t *archive_handle, unsigned sz, int g | |||
105 | value = end + 1; | 105 | value = end + 1; |
106 | 106 | ||
107 | #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS | 107 | #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS |
108 | if (!global && strncmp(value, "path=", sizeof("path=") - 1) == 0) { | 108 | if (!global && is_prefixed_with(value, "path=")) { |
109 | value += sizeof("path=") - 1; | 109 | value += sizeof("path=") - 1; |
110 | free(archive_handle->tar__longname); | 110 | free(archive_handle->tar__longname); |
111 | archive_handle->tar__longname = xstrdup(value); | 111 | archive_handle->tar__longname = xstrdup(value); |
@@ -118,7 +118,7 @@ static void process_pax_hdr(archive_handle_t *archive_handle, unsigned sz, int g | |||
118 | * This is what Red Hat's patched version of tar uses. | 118 | * This is what Red Hat's patched version of tar uses. |
119 | */ | 119 | */ |
120 | # define SELINUX_CONTEXT_KEYWORD "RHT.security.selinux" | 120 | # define SELINUX_CONTEXT_KEYWORD "RHT.security.selinux" |
121 | if (strncmp(value, SELINUX_CONTEXT_KEYWORD"=", sizeof(SELINUX_CONTEXT_KEYWORD"=") - 1) == 0) { | 121 | if (is_prefixed_with(value, SELINUX_CONTEXT_KEYWORD"=")) { |
122 | value += sizeof(SELINUX_CONTEXT_KEYWORD"=") - 1; | 122 | value += sizeof(SELINUX_CONTEXT_KEYWORD"=") - 1; |
123 | free(archive_handle->tar__sctx[global]); | 123 | free(archive_handle->tar__sctx[global]); |
124 | archive_handle->tar__sctx[global] = xstrdup(value); | 124 | archive_handle->tar__sctx[global] = xstrdup(value); |
@@ -202,7 +202,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
202 | 202 | ||
203 | /* Check header has valid magic, "ustar" is for the proper tar, | 203 | /* Check header has valid magic, "ustar" is for the proper tar, |
204 | * five NULs are for the old tar format */ | 204 | * five NULs are for the old tar format */ |
205 | if (strncmp(tar.magic, "ustar", 5) != 0 | 205 | if (!is_prefixed_with(tar.magic, "ustar") |
206 | && (!ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY | 206 | && (!ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY |
207 | || memcmp(tar.magic, "\0\0\0\0", 5) != 0) | 207 | || memcmp(tar.magic, "\0\0\0\0", 5) != 0) |
208 | ) { | 208 | ) { |