summaryrefslogtreecommitdiff
path: root/tar/tar2sqfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tar/tar2sqfs.c')
-rw-r--r--tar/tar2sqfs.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c
index 0dad73a..1b7d3aa 100644
--- a/tar/tar2sqfs.c
+++ b/tar/tar2sqfs.c
@@ -266,7 +266,13 @@ static int process_tar_ball(fstree_t *fs, data_writer_t *data)
skip = false;
- if (hdr.unknown_record) {
+ if (hdr.name == NULL || canonicalize_name(hdr.name) != 0) {
+ fprintf(stderr, "skipping '%s' (invalid name)\n",
+ hdr.name);
+ skip = true;
+ }
+
+ if (!skip && hdr.unknown_record) {
fprintf(stderr, "%s: unknown entry type\n", hdr.name);
skip = true;
}
@@ -301,14 +307,6 @@ static int process_tar_ball(fstree_t *fs, data_writer_t *data)
continue;
}
- if (canonicalize_name(hdr.name)) {
- fprintf(stderr, "skipping '%s' (invalid name)\n",
- hdr.name);
- if (skip_entry(STDIN_FILENO, hdr.sb.st_size))
- goto fail;
- continue;
- }
-
if (create_node_and_repack_data(&hdr, fs, data))
goto fail;