Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2010 18:59:07 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208957 - head/usr.bin/unzip
Message-ID:  <201006091859.o59Ix8Ve011102@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006091859.o59Ix8Ve011102>