From owner-svn-src-all@FreeBSD.ORG Wed Jun 9 18:59:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311C11065678; Wed, 9 Jun 2010 18:59:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20DC58FC15; Wed, 9 Jun 2010 18:59:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59Ix8fS011104; Wed, 9 Jun 2010 18:59:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59Ix8Ve011102; Wed, 9 Jun 2010 18:59:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006091859.o59Ix8Ve011102@svn.freebsd.org> From: Xin LI Date: Wed, 9 Jun 2010 18:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208957 - head/usr.bin/unzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 18:59:08 -0000 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));