summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-04 12:45:44 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-04 12:46:07 +0200
commit56c1be44b5f77b067994a6f8f6ef2b397d7acadc (patch)
treed456b97b5e9a304aa2410ceb5894a069977aeddd /lib
parent9899d4181084b0cb488fe6161ac3ffe9ccd55c29 (diff)
Fix composition order of prefix + name for ustar
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/tar/read_header.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/tar/read_header.c b/lib/tar/read_header.c
index 1506037..db40d7d 100644
--- a/lib/tar/read_header.c
+++ b/lib/tar/read_header.c
@@ -212,10 +212,9 @@ static int decode_header(const tar_header_t *hdr, unsigned int set_by_pax,
out->name = malloc(len1 + 1 + len2 + 1);
if (out->name != NULL) {
- memcpy(out->name, hdr->name, len1);
- out->name[len1] = '/';
- memcpy(out->name + len1 + 1,
- hdr->tail.posix.prefix, len2);
+ memcpy(out->name, hdr->tail.posix.prefix, len2);
+ out->name[len2] = '/';
+ memcpy(out->name + len2 + 1, hdr->name, len1);
out->name[len1 + 1 + len2] = '\0';
}
} else {