Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Mar 2009 04:22:34 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189428 - head/lib/libarchive
Message-ID:  <200903060422.n264MY3l007794@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kientzle
Date: Fri Mar  6 04:22:34 2009
New Revision: 189428
URL: http://svn.freebsd.org/changeset/base/189428

Log:
  Merge r398 from libarchive.googlecode.com: Check that bidder
  object was allocated before we try to use it.

Modified:
  head/lib/libarchive/archive_read_support_compression_program.c

Modified: head/lib/libarchive/archive_read_support_compression_program.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_program.c	Fri Mar  6 04:21:23 2009	(r189427)
+++ head/lib/libarchive/archive_read_support_compression_program.c	Fri Mar  6 04:22:34 2009	(r189428)
@@ -109,12 +109,12 @@ archive_read_support_compression_program
 	struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
 	struct program_bidder *state;
 
-	state = (struct program_bidder *)calloc(sizeof (*state), 1);
+	if (bidder == NULL)
+		return (ARCHIVE_FATAL);
 
+	state = (struct program_bidder *)calloc(sizeof (*state), 1);
 	if (state == NULL)
 		return (ARCHIVE_FATAL);
-	if (bidder == NULL)
-		return (ARCHIVE_FATAL);
 
 	state->cmd = strdup(cmd);
 	state->bid = INT_MAX;



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