summaryrefslogtreecommitdiffstats
path: root/usr.bin/unzip
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2010-06-09 18:59:07 +0000
committerdelphij <delphij@FreeBSD.org>2010-06-09 18:59:07 +0000
commitc0c0ff241b4de015cc70e3dcb589efcc3323681b (patch)
treecb3cd139db40e18787cb0d485fedb368f20779ef /usr.bin/unzip
parenta1185afe0f653cca036f117b540fefc6f799e95d (diff)
downloadFreeBSD-src-c0c0ff241b4de015cc70e3dcb589efcc3323681b.zip
FreeBSD-src-c0c0ff241b4de015cc70e3dcb589efcc3323681b.tar.gz
Check return value from archive_read_new().
Found with: Coverity Prevent(tm) CID: 8462 Reviewed by: des MFC after: 1 week
Diffstat (limited to 'usr.bin/unzip')
-rw-r--r--usr.bin/unzip/unzip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/unzip/unzip.c b/usr.bin/unzip/unzip.c
index b80810c..87927d2 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));
OpenPOWER on IntegriCloud