bootstrap: tar: fix pointer-alignment tar parsing issue

This commit is contained in:
2026-03-15 09:47:58 +00:00
parent d03c750e4a
commit 5dd99bb0a6

View File

@@ -74,8 +74,10 @@ int tar_open(struct tar *tar, const char *path, struct tar_file *out)
} }
s += header.size; s += header.size;
s += ((sizeof *bin_header) if ((uintptr_t)s % (sizeof *bin_header)) {
- ((uintptr_t)s % (sizeof *bin_header))); s += ((sizeof *bin_header)
- ((uintptr_t)s % (sizeof *bin_header)));
}
bin_header = (struct tar_bin_header *)s; bin_header = (struct tar_bin_header *)s;
} }
@@ -382,8 +384,10 @@ static enum fs_status build_dentry_tree(
} }
s += header.size; s += header.size;
s += ((sizeof *bin_header) if ((uintptr_t)s % (sizeof *bin_header)) {
- ((uintptr_t)s % (sizeof *bin_header))); s += ((sizeof *bin_header)
- ((uintptr_t)s % (sizeof *bin_header)));
}
bin_header = (struct tar_bin_header *)s; bin_header = (struct tar_bin_header *)s;
} }