(pax_decode_header): fix the loop range.

The high boundary 'u' of loop was modified in the loop as a result of
decode_num().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-08-12 20:41:11 +03:00
parent 02dea0d65d
commit 7e61d298b8

View File

@ -657,6 +657,7 @@ pax_decode_header (tar_super_t * archive, struct tar_sparse_file *file)
char nbuf[UINTMAX_STRSIZE_BOUND];
union block *blk;
char *p;
size_t sparse_map_len;
size_t i;
off_t start;
@ -681,7 +682,9 @@ pax_decode_header (tar_super_t * archive, struct tar_sparse_file *file)
else
g_array_set_size (file->stat_info->sparse_map, u);
for (i = 0; i < u; i++)
sparse_map_len = u;
for (i = 0; i < sparse_map_len; i++)
{
struct sp_array sp;