]> Dogcows Code - chaz/tar/commit
tar: don't assume size of a sparse file chunk fits in size_t
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 24 Aug 2010 23:50:31 +0000 (16:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 24 Aug 2010 23:50:49 +0000 (16:50 -0700)
commita59c819beb4886ee43f16dfd80ec1151fda1abe6
treea2ae6da893d6e0f430612a8b09decf98da28639f
parent57b11473b0135b1e092cf045f94635c934c7c63f
tar: don't assume size of a sparse file chunk fits in size_t

* src/tar.h (struct sp_array): Change numbytes from size_t to off_t.
All uses changed.
* scripts/xsparse.c (struct sp_array): Likewise.
Include <stdint.h>, for SIZE_MAX.
(expand_sparse): Don't try to allocate a buffer bigger than
SIZE_MAX bytes.
* src/common.h (SIZE_TO_CHARS, size_to_chars, SIZE_FROM_HEADER):
(size_from_header): Remove decls.
* src/create.c (size_to_chars): Remove.
* src/list.c (size_from_header): Remove.
* src/sparse.c (sparse_extract_region, check_data_region):
(oldgnu_add_sparse, oldgnu_store_sparse_info, pax_decode_header):
Don't assume chunk sizes fit in size_t.
(oldgnu_add_sparse): Check for off_t overflow.
* src/xheader.c (sparse_numbytes_decoder, sparse_map_decoder):
Likewise.
scripts/xsparse.c
src/common.h
src/create.c
src/list.c
src/sparse.c
src/tar.h
src/xheader.c
This page took 0.023984 seconds and 4 git commands to generate.