Fix segmentation fault in tar(1)

This commit is contained in:
FRIGN 2015-03-03 11:26:59 +01:00
parent 0b9c02cd22
commit c8f2b068f6
1 changed files with 3 additions and 2 deletions

5
tar.c
View File

@ -85,13 +85,14 @@ putoctal(char *dst, unsigned num, int n)
static int static int
archive(const char* path) archive(const char* path)
{ {
FILE *f; FILE *f = NULL;
mode_t mode; mode_t mode;
struct group *gr; struct group *gr;
struct header *h; struct header *h;
struct passwd *pw; struct passwd *pw;
struct stat st; struct stat st;
size_t chksum, l, x; size_t chksum, x;
ssize_t l;
unsigned char b[BLKSIZ]; unsigned char b[BLKSIZ];
lstat(path, &st); lstat(path, &st);