diff options
author | Mike Frysinger | 2006-08-24 03:06:55 +0000 |
---|---|---|
committer | Mike Frysinger | 2006-08-24 03:06:55 +0000 |
commit | f23b96cebfe169eee7131efd8b879748587d1845 (patch) | |
tree | a4a0caf443011bdfed1e103871066ea8fb90faf3 /archival | |
parent | f86a5ba510ef62ab46d14bd0761a1d88289a398d (diff) | |
download | busybox-1_2_1.zip busybox-1_2_1.tar.gz |
tag busybox-1.2.11_2_1
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 4394d23..0f31962 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -1,4 +1,3 @@ -/* vi: set sw=4 ts=4: */ /* Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * * FIXME: @@ -56,7 +55,11 @@ char get_header_tar(archive_handle_t *archive_handle) /* Align header */ data_align(archive_handle, 512); - xread(archive_handle->src_fd, tar.raw, 512); + if (bb_full_read(archive_handle->src_fd, tar.raw, 512) != 512) { + /* Assume end of file */ + bb_error_msg_and_die("Short header"); + //return(EXIT_FAILURE); + } archive_handle->offset += 512; /* If there is no filename its an empty header */ @@ -65,7 +68,7 @@ char get_header_tar(archive_handle_t *archive_handle) /* This is the second consecutive empty header! End of archive! * Read until the end to empty the pipe from gz or bz2 */ - while (full_read(archive_handle->src_fd, tar.raw, 512) == 512); + while (bb_full_read(archive_handle->src_fd, tar.raw, 512) == 512); return(EXIT_FAILURE); } end = 1; @@ -162,14 +165,14 @@ char get_header_tar(archive_handle_t *archive_handle) #ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS case 'L': { longname = xzalloc(file_header->size + 1); - xread(archive_handle->src_fd, longname, file_header->size); + archive_xread_all(archive_handle, longname, file_header->size); archive_handle->offset += file_header->size; return(get_header_tar(archive_handle)); } case 'K': { linkname = xzalloc(file_header->size + 1); - xread(archive_handle->src_fd, linkname, file_header->size); + archive_xread_all(archive_handle, linkname, file_header->size); archive_handle->offset += file_header->size; file_header->name = linkname; |