X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Flist.c;h=ee8bd72f7642a027639f829628573d10b9f15923;hb=4719a5d55b529e33046a39db53672d7610767614;hp=a62c706261a58ca142f19e9fb532c802b4328a6b;hpb=cff5cfb5ce59d93d15733d286cfb9ac73f33d6c7;p=chaz%2Ftar diff --git a/src/list.c b/src/list.c index a62c706..ee8bd72 100644 --- a/src/list.c +++ b/src/list.c @@ -1,7 +1,7 @@ /* List a tar archive, with support routines for reading a tar archive. Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, - 2001, 2003, 2004 Free Software Foundation, Inc. + 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Written by John Gilmore, on 1985-08-26. @@ -378,7 +378,11 @@ read_header (bool raw_extended_headers) || header->header.typeflag == GNUTYPE_LONGLINK) { size_t name_size = current_stat_info.stat.st_size; - size = name_size - name_size % BLOCKSIZE + 2 * BLOCKSIZE; + size_t n = name_size % BLOCKSIZE; + size = name_size + BLOCKSIZE; + if (n) + size += BLOCKSIZE - n; + if (name_size != current_stat_info.stat.st_size || size < name_size) xalloc_die ();