diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/init/tar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init/tar.c b/src/init/tar.c index 89f4e69..1a064d6 100644 --- a/src/init/tar.c +++ b/src/init/tar.c @@ -64,7 +64,8 @@ static void *tar_find(const char *path, size_t path_len, void *base, size_t base for (size_t off = 0; off < base_len;) { if (0 != memcmp(base + off + 257, "ustar", 5)) break; // not a metadata sector - if (0 == memcmp(base + off, path, path_len)) + if (0 == memcmp(base + off, path, path_len) && + *(char*)(base + off + path_len) == '\0') return base + off; // file found, quit size = tar_size(base + off); |