diff options
| author | Guillem Jover <guillem@debian.org> | 2019-03-06 03:52:10 +0100 |
|---|---|---|
| committer | Guillem Jover <guillem@debian.org> | 2019-03-24 03:30:12 +0100 |
| commit | a1f9ccf08ddc99e4e3f1ead01abb6a8d8d506b3a (patch) | |
| tree | 248f73fb194b58f35e0a1297b44a366a29f6cd96 /lib | |
| parent | 04b6b5bb2def5e361ae54d44664602fbeacb4398 (diff) | |
| download | dpkg-a1f9ccf08ddc99e4e3f1ead01abb6a8d8d506b3a.tar.gz | |
libdpkg: Handle non end-of-tape errors from tar_header_decode()
We need to assign a status value in the non end-of-tape branch,
otherwise we are using an uninitialized value, which might be anything,
and could end up making the code proceed even if the archive is
damaged/broken, etc.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dpkg/tarfn.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/dpkg/tarfn.c b/lib/dpkg/tarfn.c index 757e0e323..7ccdae389 100644 --- a/lib/dpkg/tarfn.c +++ b/lib/dpkg/tarfn.c @@ -466,6 +466,8 @@ tar_extractor(struct tar_archive *tar) if (h.name[0] == '\0') { /* End Of Tape. */ status = 0; + } else { + status = -1; } tar_entry_destroy(&h); break; |
