[hackers] [sbase] tar: compatibility, allow empty magic aswell || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sun, 10 May 2015 13:58:43 +0200 (CEST)

commit 9d95321f0b3e200b0766ea7635a32ed29e76934a
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun May 10 11:13:02 2015 +0200

    tar: compatibility, allow empty magic aswell

diff --git a/tar.c b/tar.c
index 01043ee..6c9bcfc 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -401,7 +401,7 @@ chktar(struct header *h)
 
         if (h->prefix[0] == '\0' && h->name[0] == '\0')
                 goto bad;
- if (strncmp("ustar", h->magic, 5))
+ if (h->magic[0] && strncmp("ustar", h->magic, 5))
                 goto bad;
         memcpy(tmp, h->chksum, sizeof(tmp));
         for (i = 0; i < sizeof(tmp); i++)
Received on Sun May 10 2015 - 13:58:43 CEST

This archive was generated by hypermail 2.3.0 : Sun May 10 2015 - 14:00:13 CEST