svn commit: r208957 - head/usr.bin/unzip

Xin LI delphij at FreeBSD.org
Wed Jun 9 18:59:08 UTC 2010


Author: delphij
Date: Wed Jun  9 18:59:07 2010
New Revision: 208957
URL: http://svn.freebsd.org/changeset/base/208957

Log:
  Check return value from archive_read_new().
  
  Found with:	Coverity Prevent(tm)
  CID:		8462
  Reviewed by:	des
  MFC after:	1 week

Modified:
  head/usr.bin/unzip/unzip.c

Modified: head/usr.bin/unzip/unzip.c
==============================================================================
--- head/usr.bin/unzip/unzip.c	Wed Jun  9 18:46:28 2010	(r208956)
+++ head/usr.bin/unzip/unzip.c	Wed Jun  9 18:59:07 2010	(r208957)
@@ -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));
 


More information about the svn-src-head mailing list