tar: compatibility, allow empty magic aswell

This commit is contained in:
Hiltjo Posthuma 2015-05-10 11:13:02 +02:00 committed by sin
parent 00883efc16
commit 9d95321f0b

2
tar.c
View File

@ -401,7 +401,7 @@ chktar(struct header *h)
if (h->prefix[0] == '\0' && h->name[0] == '\0') if (h->prefix[0] == '\0' && h->name[0] == '\0')
goto bad; goto bad;
if (strncmp("ustar", h->magic, 5)) if (h->magic[0] && strncmp("ustar", h->magic, 5))
goto bad; goto bad;
memcpy(tmp, h->chksum, sizeof(tmp)); memcpy(tmp, h->chksum, sizeof(tmp));
for (i = 0; i < sizeof(tmp); i++) for (i = 0; i < sizeof(tmp); i++)