diff options
author | Xin LI <delphij@FreeBSD.org> | 2010-06-09 18:59:07 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2010-06-09 18:59:07 +0000 |
commit | d9942426478087eb1f36fea44b9f686724e59102 (patch) | |
tree | cb3cd139db40e18787cb0d485fedb368f20779ef /usr.bin/unzip/unzip.c | |
parent | bff23f82e51a4c6014848c22271a42f92c258473 (diff) | |
download | src-d9942426478087eb1f36fea44b9f686724e59102.tar.gz src-d9942426478087eb1f36fea44b9f686724e59102.zip |
Check return value from archive_read_new().
Found with: Coverity Prevent(tm)
CID: 8462
Reviewed by: des
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=208957
Diffstat (limited to 'usr.bin/unzip/unzip.c')
-rw-r--r-- | usr.bin/unzip/unzip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/unzip/unzip.c b/usr.bin/unzip/unzip.c index b80810cb1cce..87927d2bb2e9 100644 --- a/usr.bin/unzip/unzip.c +++ b/usr.bin/unzip/unzip.c @@ -862,7 +862,9 @@ unzip(const char *fn) if ((fd = open(fn, O_RDONLY)) < 0) error("%s", fn); - a = archive_read_new(); + if ((a = archive_read_new()) == NULL) + error("archive_read_new failed"); + ac(archive_read_support_format_zip(a)); ac(archive_read_open_fd(a, fd, 8192)); |