svn commit: r318181 - head/contrib/libarchive/cpio/test

Ngie Cooper ngie at FreeBSD.org
Thu May 11 08:22:02 UTC 2017


Author: ngie
Date: Thu May 11 08:22:01 2017
New Revision: 318181
URL: https://svnweb.freebsd.org/changeset/base/318181

Log:
  cpio/tests/test_option_lz4: fix a use after free in the failure case
  
  This change will be upstreamed to the libarchive project.
  
  MFC after:	6 days
  MFC with:	r317782
  Reported by:	Coverity
  Sponsored by:	Dell EMC Isilon

Modified:
  head/contrib/libarchive/cpio/test/test_option_lz4.c

Modified: head/contrib/libarchive/cpio/test/test_option_lz4.c
==============================================================================
--- head/contrib/libarchive/cpio/test/test_option_lz4.c	Thu May 11 08:06:46 2017	(r318180)
+++ head/contrib/libarchive/cpio/test/test_option_lz4.c	Thu May 11 08:22:01 2017	(r318181)
@@ -74,8 +74,8 @@ DEFINE_TEST(test_option_lz4)
 			free(p);
 			return;
 		}
-		free(p);
 		failure("--lz4 option is broken: %s", p);
+		free(p);
 		assertEqualInt(r, 0);
 		return;
 	}


More information about the svn-src-head mailing list