From owner-svn-src-vendor@freebsd.org Mon Dec 12 02:09:32 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82336C73C42; Mon, 12 Dec 2016 02:09:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CAF81921; Mon, 12 Dec 2016 02:09:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC29VOi061898; Mon, 12 Dec 2016 02:09:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC29Vvb061894; Mon, 12 Dec 2016 02:09:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612120209.uBC29Vvb061894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Dec 2016 02:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309863 - vendor/libarchive/dist/cpio/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2016 02:09:32 -0000 Author: ngie Date: Mon Dec 12 02:09:31 2016 New Revision: 309863 URL: https://svnweb.freebsd.org/changeset/base/309863 Log: Free p (the memory allocated via slurpfile) when done with the contents Reported by: Coverity CID: 1331631, 1331632, 1331633, 1331646 Obtained from: libarchive (ebe29c0ec3b1aaa424df9cf884721c6018c676f4) Modified: vendor/libarchive/dist/cpio/test/test_option_J_upper.c vendor/libarchive/dist/cpio/test/test_option_Z_upper.c vendor/libarchive/dist/cpio/test/test_option_u.c vendor/libarchive/dist/cpio/test/test_option_y.c Modified: vendor/libarchive/dist/cpio/test/test_option_J_upper.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_J_upper.c Mon Dec 12 00:47:12 2016 (r309862) +++ vendor/libarchive/dist/cpio/test/test_option_J_upper.c Mon Dec 12 02:09:31 2016 (r309863) @@ -47,10 +47,13 @@ DEFINE_TEST(test_option_J_upper) } failure("-J option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an xz signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\3757zXZ", 5); +done: + free(p); } Modified: vendor/libarchive/dist/cpio/test/test_option_Z_upper.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_Z_upper.c Mon Dec 12 00:47:12 2016 (r309862) +++ vendor/libarchive/dist/cpio/test/test_option_Z_upper.c Mon Dec 12 02:09:31 2016 (r309863) @@ -47,10 +47,13 @@ DEFINE_TEST(test_option_Z_upper) } failure("-Z option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has a compress signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x1f\x9d", 2); +done: + free(p); } Modified: vendor/libarchive/dist/cpio/test/test_option_u.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_u.c Mon Dec 12 00:47:12 2016 (r309862) +++ vendor/libarchive/dist/cpio/test/test_option_u.c Mon Dec 12 02:09:31 2016 (r309863) @@ -49,6 +49,7 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "a", 1); + free(p); /* Recreate the file with a single "b" */ assertMakeFile("f", 0644, "b"); @@ -68,6 +69,7 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "a", 1); + free(p); /* Copy the file to the "copy" dir with -u (force) */ r = systemf("echo f| %s -pud copy >copy.out 2>copy.err", @@ -78,4 +80,5 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "b", 1); + free(p); } Modified: vendor/libarchive/dist/cpio/test/test_option_y.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_y.c Mon Dec 12 00:47:12 2016 (r309862) +++ vendor/libarchive/dist/cpio/test/test_option_y.c Mon Dec 12 02:09:31 2016 (r309863) @@ -46,11 +46,14 @@ DEFINE_TEST(test_option_y) } failure("-y option is broken"); assertEqualInt(r, 0); - return; + goto done; } assertTextFileContents("1 block\n", "archive.err"); /* Check that the archive file has a bzip2 signature. */ + free(p); p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "BZh9", 4); +done: + free(p); } From owner-svn-src-vendor@freebsd.org Mon Dec 12 02:11:33 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99FA4C73CA7; Mon, 12 Dec 2016 02:11:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9731B27; Mon, 12 Dec 2016 02:11:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2BWEW063563; Mon, 12 Dec 2016 02:11:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2BUJM063541; Mon, 12 Dec 2016 02:11:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612120211.uBC2BUJM063541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Dec 2016 02:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309864 - vendor/libarchive/dist/tar/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2016 02:11:33 -0000 Author: ngie Date: Mon Dec 12 02:11:30 2016 New Revision: 309864 URL: https://svnweb.freebsd.org/changeset/base/309864 Log: Merge PR to address tar/test coverity issues Obtained from: libarchive (fd0ea220635939ffe4b9ffb5cacaaa526a25b5ae) Modified: vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/test/test_leading_slash.c vendor/libarchive/dist/tar/test/test_option_a.c vendor/libarchive/dist/tar/test/test_option_b.c vendor/libarchive/dist/tar/test/test_option_b64encode.c vendor/libarchive/dist/tar/test/test_option_gid_gname.c vendor/libarchive/dist/tar/test/test_option_grzip.c vendor/libarchive/dist/tar/test/test_option_j.c vendor/libarchive/dist/tar/test/test_option_lrzip.c vendor/libarchive/dist/tar/test/test_option_lz4.c vendor/libarchive/dist/tar/test/test_option_lzma.c vendor/libarchive/dist/tar/test/test_option_lzop.c vendor/libarchive/dist/tar/test/test_option_r.c vendor/libarchive/dist/tar/test/test_option_uid_uname.c vendor/libarchive/dist/tar/test/test_option_uuencode.c vendor/libarchive/dist/tar/test/test_option_xz.c vendor/libarchive/dist/tar/test/test_option_z.c vendor/libarchive/dist/tar/test/test_stdio.c vendor/libarchive/dist/tar/test/test_version.c Modified: vendor/libarchive/dist/tar/test/main.c ============================================================================== --- vendor/libarchive/dist/tar/test/main.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/main.c Mon Dec 12 02:11:30 2016 (r309864) @@ -1060,7 +1060,7 @@ assertion_file_contains_lines_any_order( char **expected = NULL; char *p, **actual = NULL; char c; - int expected_failure = 0, actual_failure = 0; + int expected_failure = 0, actual_failure = 0, retval = 0; assertion_count(file, line); @@ -1081,8 +1081,7 @@ assertion_file_contains_lines_any_order( if (expected == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); - free(expected); - return (0); + goto done; } for (i = 0; lines[i] != NULL; ++i) { expected[i] = strdup(lines[i]); @@ -1103,8 +1102,7 @@ assertion_file_contains_lines_any_order( if (actual == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); - free(expected); - return (0); + goto done; } for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { @@ -1141,27 +1139,27 @@ assertion_file_contains_lines_any_order( ++actual_failure; } if (expected_failure == 0 && actual_failure == 0) { - free(buff); - free(expected); - free(actual); - return (1); + retval = 1; + goto done; } failure_start(file, line, "File doesn't match: %s", pathname); for (i = 0; i < expected_count; ++i) { - if (expected[i] != NULL) { + if (expected[i] != NULL) logprintf(" Expected but not present: %s\n", expected[i]); - free(expected[i]); - } } for (j = 0; j < actual_count; ++j) { if (actual[j] != NULL) logprintf(" Present but not expected: %s\n", actual[j]); } failure_finish(NULL); +done: + free(actual); free(buff); + for (i = 0; i < expected_count; ++i) + free(expected[i]); free(expected); - free(actual); - return (0); + + return (retval); } /* Verify that a text file does not contains the specified strings */ @@ -1590,7 +1588,7 @@ is_symlink(const char *file, int line, * really not much point in bothering with this. */ return (0); #else - char buff[300]; + char buff[301]; struct stat st; ssize_t linklen; int r; @@ -1607,7 +1605,7 @@ is_symlink(const char *file, int line, return (0); if (contents == NULL) return (1); - linklen = readlink(pathname, buff, sizeof(buff)); + linklen = readlink(pathname, buff, sizeof(buff) - 1); if (linklen < 0) { failure_start(file, line, "Can't read symlink %s", pathname); failure_finish(NULL); @@ -2324,7 +2322,7 @@ extract_reference_file(const char *name) for (;;) { if (fgets(buff, sizeof(buff), in) == NULL) { /* TODO: This is a failure. */ - return; + goto done; } if (memcmp(buff, "begin ", 6) == 0) break; @@ -2365,6 +2363,7 @@ extract_reference_file(const char *name) } } fclose(out); +done: fclose(in); } @@ -2958,8 +2957,8 @@ main(int argc, char **argv) strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp), "%Y-%m-%dT%H.%M.%S", localtime(&now)); - sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname, - tmpdir_timestamp, i); + snprintf(tmpdir, sizeof(tmpdir), "%s/%s.%s-%03d", tmp, + progname, tmpdir_timestamp, i); if (assertMakeDir(tmpdir,0755)) break; if (i >= 999) { Modified: vendor/libarchive/dist/tar/test/test_leading_slash.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_leading_slash.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_leading_slash.c Mon Dec 12 02:11:30 2016 (r309864) @@ -44,6 +44,7 @@ DEFINE_TEST(test_leading_slash) if (assertFileExists("test.err")) { errfile = slurpfile(&errfile_size, "test.err"); assert(strstr(errfile, expected_errmsg) != NULL); + free(errfile); } } Modified: vendor/libarchive/dist/tar/test/test_option_a.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_a.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_a.c Mon Dec 12 02:11:30 2016 (r309864) @@ -43,6 +43,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test2: archive it with .taZ suffix. */ assertEqualInt(0, @@ -53,6 +54,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test3: archive it with .tar.Z.uu suffix. */ assertEqualInt(0, @@ -63,6 +65,7 @@ DEFINE_TEST(test_option_a) assert(s > 12); failure("The archive should be uuencoded"); assertEqualMem(p, "begin 644 -\n", 12); + free(p); /* Test4: archive it with .zip suffix. */ assertEqualInt(0, @@ -73,6 +76,7 @@ DEFINE_TEST(test_option_a) assert(s > 4); failure("The archive should be zipped"); assertEqualMem(p, "\x50\x4b\x03\x04", 4); + free(p); /* Test5: archive it with .tar.Z suffix and --uuencode option. */ assertEqualInt(0, @@ -84,6 +88,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed, ignoring --uuencode option"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test6: archive it with .xxx suffix(unknown suffix) and * --uuencode option. */ @@ -96,6 +101,7 @@ DEFINE_TEST(test_option_a) assert(s > 12); failure("The archive should be uuencoded"); assertEqualMem(p, "begin 644 -\n", 12); + free(p); /* Test7: archive it with .tar.Z suffix using a long-name option. */ assertEqualInt(0, @@ -107,4 +113,5 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_b.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_b.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_b.c Mon Dec 12 02:11:30 2016 (r309864) @@ -78,4 +78,6 @@ DEFINE_TEST(test_option_b) * Note: It's not possible to verify at this level that blocks * are getting written with the */ + + free(testprog_ustar); } Modified: vendor/libarchive/dist/tar/test/test_option_b64encode.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_b64encode.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_b64encode.c Mon Dec 12 02:11:30 2016 (r309864) @@ -42,6 +42,7 @@ DEFINE_TEST(test_option_b64encode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin-base64 644", 16); + free(p); /* Archive it with uuencode only. */ assertEqualInt(0, @@ -51,4 +52,5 @@ DEFINE_TEST(test_option_b64encode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin-base64 644", 16); + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_gid_gname.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_gid_gname.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_gid_gname.c Mon Dec 12 02:11:30 2016 (r309864) @@ -53,6 +53,7 @@ DEFINE_TEST(test_option_gid_gname) /* Should force gid and gname fields in ustar header. */ assertEqualMem(data + 116, "000021 \0", 8); assertEqualMem(data + 297, "foofoofoo\0", 10); + free(data); /* Again with just --gname */ failure("Error invoking %s c", testprog); @@ -65,6 +66,8 @@ DEFINE_TEST(test_option_gid_gname) /* Gid should be unchanged from original reference. */ assertEqualMem(data + 116, reference + 116, 8); assertEqualMem(data + 297, "foofoofoo\0", 10); + free(data); + free(reference); /* Again with --gid and force gname to empty. */ failure("Error invoking %s c", testprog); @@ -77,6 +80,7 @@ DEFINE_TEST(test_option_gid_gname) assertEqualMem(data + 116, "000021 \0", 8); /* Gname field in ustar header should be empty. */ assertEqualMem(data + 297, "\0", 1); + free(data); /* TODO: It would be nice to verify that --gid= by itself * will look up the associated gname and use that, but Modified: vendor/libarchive/dist/tar/test/test_option_grzip.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_grzip.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_grzip.c Mon Dec 12 02:11:30 2016 (r309864) @@ -45,8 +45,11 @@ DEFINE_TEST(test_option_grzip) testprog)); p = slurpfile(&s, "archive.err"); p[s] = '\0'; + free(p); + /* Check that the archive file has an grzip signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12); + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_j.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_j.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_j.c Mon Dec 12 02:11:30 2016 (r309864) @@ -42,15 +42,18 @@ DEFINE_TEST(test_option_j) if (r != 0) { if (!canBzip2()) { skipping("bzip2 is not supported on this platform"); - return; + goto done; } failure("-j option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); assertEmptyFile("archive.err"); /* Check that the archive file has a bzip2 signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "BZh9", 4); +done: + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_lrzip.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_lrzip.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_lrzip.c Mon Dec 12 02:11:30 2016 (r309864) @@ -45,8 +45,10 @@ DEFINE_TEST(test_option_lrzip) testprog)); p = slurpfile(&s, "archive.err"); p[s] = '\0'; + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "LRZI\x00", 5); + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_lz4.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_lz4.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_lz4.c Mon Dec 12 02:11:30 2016 (r309864) @@ -43,7 +43,7 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Unsupported compression") != NULL) { skipping("This version of bsdtar was compiled " "without lz4 support"); - return; + goto done; } /* POSIX permits different handling of the spawnp * system call used to launch the subsidiary @@ -52,7 +52,7 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Can't launch") != NULL && !canLz4()) { skipping("This version of bsdtar uses an external lz4 program " "but no such program is available on this system."); - return; + goto done; } /* Some systems successfully spawn the new process, * but fail to exec a program within that process. @@ -61,14 +61,18 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Can't write") != NULL && !canLz4()) { skipping("This version of bsdtar uses an external lz4 program " "but no such program is available on this system."); - return; + goto done; } failure("--lz4 option is broken: %s", p); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lz4 signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x04\x22\x4d\x18", 4); + +done: + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_lzma.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_lzma.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_lzma.c Mon Dec 12 02:11:30 2016 (r309864) @@ -48,10 +48,13 @@ DEFINE_TEST(test_option_lzma) } failure("--lzma option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x5d\00\00", 3); +done: + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_lzop.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_lzop.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_lzop.c Mon Dec 12 02:11:30 2016 (r309864) @@ -42,14 +42,17 @@ DEFINE_TEST(test_option_lzop) if (r != 0) { if (!canLzop()) { skipping("lzop is not supported on this platform"); - return; + goto done; } failure("--lzop option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9); +done: + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_r.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_r.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_r.c Mon Dec 12 02:11:30 2016 (r309864) @@ -36,6 +36,10 @@ DEFINE_TEST(test_option_r) size_t s, buff_size_rounded; int r, i; + buff = NULL; + p0 = NULL; + p1 = NULL; + /* Create an archive with one file. */ assertMakeFile("f1", 0644, "abc"); r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog); @@ -47,11 +51,9 @@ DEFINE_TEST(test_option_r) /* Do some basic validation of the constructed archive. */ p0 = slurpfile(&s, "archive.tar"); if (!assert(p0 != NULL)) - return; - if (!assert(s >= 2048)) { - free(p0); - return; - } + goto done; + if (!assert(s >= 2048)) + goto done; assertEqualMem(p0 + 0, "f1", 3); assertEqualMem(p0 + 512, "abc", 3); assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8); @@ -60,10 +62,8 @@ DEFINE_TEST(test_option_r) /* Edit that file with a lot more data and update the archive with a new copy. */ buff = malloc(buff_size); assert(buff != NULL); - if (buff == NULL) { - free(p0); - return; - } + if (buff == NULL) + goto done; for (i = 0; i < (int)buff_size; ++i) buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26]; @@ -77,10 +77,8 @@ DEFINE_TEST(test_option_r) /* The constructed archive should just have the new entry appended. */ p1 = slurpfile(&s, "archive.tar"); - if (!assert(p1 != NULL)) { - free(p0); - return; - } + if (!assert(p1 != NULL)) + goto done; buff_size_rounded = ((buff_size + 511) / 512) * 512; assert(s >= 2560 + buff_size_rounded); /* Verify first entry is unchanged. */ @@ -105,10 +103,8 @@ DEFINE_TEST(test_option_r) /* Validate the constructed archive. */ p1 = slurpfile(&s, "archive.tar"); - if (!assert(p1 != NULL)) { - free(p0); - return; - } + if (!assert(p1 != NULL)) + goto done; assert(s >= 3584 + buff_size_rounded); /* Verify first two entries are unchanged. */ assertEqualMem(p0, p1, 1536 + buff_size_rounded); @@ -118,7 +114,6 @@ DEFINE_TEST(test_option_r) /* Verify end-of-archive marker. */ assertEqualMem(p1 + 2560 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8); assertEqualMem(p1 + 3072 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8); - free(p0); free(p1); /* Unpack everything */ @@ -132,4 +127,7 @@ DEFINE_TEST(test_option_r) /* Verify that the second copy of f1 overwrote the first. */ assertFileContents(buff, (int)strlen(buff), "f1"); +done: + free(buff); + free(p0); } Modified: vendor/libarchive/dist/tar/test/test_option_uid_uname.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_uid_uname.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_uid_uname.c Mon Dec 12 02:11:30 2016 (r309864) @@ -53,6 +53,7 @@ DEFINE_TEST(test_option_uid_uname) /* Should force uid and uname fields in ustar header. */ assertEqualMem(data + 108, "000021 \0", 8); assertEqualMem(data + 265, "foofoofoo\0", 10); + free(data); /* Again with just --uid */ failure("Error invoking %s c", testprog); @@ -65,6 +66,7 @@ DEFINE_TEST(test_option_uid_uname) assertEqualMem(data + 108, "000021 \0", 8); /* Uname field in ustar header should be empty. */ assertEqualMem(data + 265, "\0", 1); + free(data); /* Again with just --uname */ failure("Error invoking %s c", testprog); @@ -77,4 +79,7 @@ DEFINE_TEST(test_option_uid_uname) /* Uid should be unchanged from original reference. */ assertEqualMem(data + 108, reference + 108, 8); assertEqualMem(data + 265, "foofoofoo\0", 10); + free(data); + + free(reference); } Modified: vendor/libarchive/dist/tar/test/test_option_uuencode.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_uuencode.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_uuencode.c Mon Dec 12 02:11:30 2016 (r309864) @@ -42,6 +42,7 @@ DEFINE_TEST(test_option_uuencode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin 644", 9); + free(p); /* Archive it with uuencode only. */ assertEqualInt(0, @@ -51,4 +52,5 @@ DEFINE_TEST(test_option_uuencode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin 644", 9); + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_xz.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_xz.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_xz.c Mon Dec 12 02:11:30 2016 (r309864) @@ -44,14 +44,17 @@ DEFINE_TEST(test_option_xz) if (strstr(p, "Unsupported compression") != NULL) { skipping("This version of bsdtar was compiled " "without xz support"); - return; + goto done; } failure("--xz option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an xz signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6); +done: + free(p); } Modified: vendor/libarchive/dist/tar/test/test_option_z.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_option_z.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_option_z.c Mon Dec 12 02:11:30 2016 (r309864) @@ -42,14 +42,17 @@ DEFINE_TEST(test_option_z) if (r != 0) { if (!canGzip()) { skipping("gzip is not supported on this platform"); - return; + goto done; } failure("-z option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has a gzip signature. */ p = slurpfile(&s, "archive.out"); assert(s > 4); assertEqualMem(p, "\x1f\x8b\x08\x00", 4); +done: + free(p); } Modified: vendor/libarchive/dist/tar/test/test_stdio.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_stdio.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_stdio.c Mon Dec 12 02:11:30 2016 (r309864) @@ -116,6 +116,7 @@ DEFINE_TEST(test_stdio) assertEqualInt((int)s, 3); assertEqualMem(p, "abc", 3); /* TODO: Verify xvf.err */ + free(p); /* 'xvf -' should generate list on stderr, empty stdout. */ r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog); Modified: vendor/libarchive/dist/tar/test/test_version.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_version.c Mon Dec 12 02:09:31 2016 (r309863) +++ vendor/libarchive/dist/tar/test/test_version.c Mon Dec 12 02:11:30 2016 (r309864) @@ -53,7 +53,7 @@ DEFINE_TEST(test_version) assert(s > 6); failure("Version must start with 'bsdtar': ``%s''", p); if (!assertEqualMem(q, "bsdtar ", 7)) - return; + goto done; q += 7; s -= 7; /* Version number is a series of digits and periods. */ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) { @@ -98,5 +98,6 @@ DEFINE_TEST(test_version) failure("Version output must end with \\n or \\r\\n"); if (*q == '\r') { ++q; --s; } assertEqualMem(q, "\n", 1); +done: free(p); } From owner-svn-src-vendor@freebsd.org Mon Dec 12 02:12:52 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA6BEC73E47; Mon, 12 Dec 2016 02:12:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB1C51EB9; Mon, 12 Dec 2016 02:12:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2CpPf065739; Mon, 12 Dec 2016 02:12:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2CpTL065735; Mon, 12 Dec 2016 02:12:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612120212.uBC2CpTL065735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Dec 2016 02:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309865 - vendor/libarchive/dist/libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2016 02:12:53 -0000 Author: ngie Date: Mon Dec 12 02:12:51 2016 New Revision: 309865 URL: https://svnweb.freebsd.org/changeset/base/309865 Log: Merge PR to address libarchive/test coverity issues Obtained from: libarchive (f9e3de49fb294901374e0c8c6c2ceaeea7b6d6c0) Modified: vendor/libarchive/dist/libarchive/test/read_open_memory.c vendor/libarchive/dist/libarchive/test/test_fuzz.c vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/libarchive/test/test_read_set_format.c Modified: vendor/libarchive/dist/libarchive/test/read_open_memory.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/read_open_memory.c Mon Dec 12 02:11:30 2016 (r309864) +++ vendor/libarchive/dist/libarchive/test/read_open_memory.c Mon Dec 12 02:12:51 2016 (r309865) @@ -86,21 +86,7 @@ static int read_open_memory_internal(struct archive *a, const void *buff, size_t size, size_t read_size, int level) { - struct read_memory_data *mine; - - mine = (struct read_memory_data *)malloc(sizeof(*mine)); - if (mine == NULL) { - archive_set_error(a, ENOMEM, "No memory"); - return (ARCHIVE_FATAL); - } - memset(mine, 0, sizeof(*mine)); - mine->start = mine->p = (const unsigned char *)buff; - mine->end = mine->start + size; - mine->read_size = read_size; - mine->copy_buff_offset = 32; - mine->copy_buff_size = read_size + mine->copy_buff_offset * 2; - mine->copy_buff = malloc(mine->copy_buff_size); - memset(mine->copy_buff, 0xA5, mine->copy_buff_size); + struct read_memory_data *mine = NULL; switch (level) { case 3: @@ -109,6 +95,20 @@ read_open_memory_internal(struct archive archive_read_set_open_callback(a, memory_read_open); archive_read_set_skip_callback(a, memory_read_skip); case 1: + mine = malloc(sizeof(*mine)); + if (mine == NULL) { + archive_set_error(a, ENOMEM, "No memory"); + return (ARCHIVE_FATAL); + } + memset(mine, 0, sizeof(*mine)); + mine->start = mine->p = (const unsigned char *)buff; + mine->end = mine->start + size; + mine->read_size = read_size; + mine->copy_buff_offset = 32; + mine->copy_buff_size = read_size + mine->copy_buff_offset * 2; + mine->copy_buff = malloc(mine->copy_buff_size); + memset(mine->copy_buff, 0xA5, mine->copy_buff_size); + archive_read_set_read_callback(a, memory_read); archive_read_set_close_callback(a, memory_read_close); archive_read_set_callback_data(a, mine); @@ -213,7 +213,8 @@ memory_read_close(struct archive *a, voi { struct read_memory_data *mine = (struct read_memory_data *)client_data; (void)a; /* UNUSED */ - free(mine->copy_buff); + if (mine != NULL) + free(mine->copy_buff); free(mine); return (ARCHIVE_OK); } Modified: vendor/libarchive/dist/libarchive/test/test_fuzz.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_fuzz.c Mon Dec 12 02:11:30 2016 (r309864) +++ vendor/libarchive/dist/libarchive/test/test_fuzz.c Mon Dec 12 02:12:51 2016 (r309865) @@ -104,16 +104,19 @@ test_fuzz(const struct files *filesets) } if (!assert(size < buffsize)) { free(rawimage); + rawimage = NULL; continue; } } else { for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - char *newraw = (char *)realloc(rawimage, oldsize + size); + char *newraw = realloc(rawimage, oldsize + size); if (!assert(newraw != NULL)) { free(rawimage); + rawimage = NULL; + free(tmp); continue; } rawimage = newraw; @@ -123,14 +126,21 @@ test_fuzz(const struct files *filesets) free(tmp); } } - if (size == 0) + if (size == 0) { + free(rawimage); + rawimage = NULL; continue; + } image = malloc(size); assert(image != NULL); if (image == NULL) { free(rawimage); + rawimage = NULL; return; } + + assert(rawimage != NULL); + srand((unsigned)time(NULL)); for (i = 0; i < 1000; ++i) { @@ -162,6 +172,7 @@ test_fuzz(const struct files *filesets) Sleep(100); #endif } + assert(f != NULL); assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f)); fclose(f); @@ -195,7 +206,7 @@ test_fuzz(const struct files *filesets) archive_read_close(a); } archive_read_free(a); -} + } free(image); free(rawimage); } Modified: vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 12 02:11:30 2016 (r309864) +++ vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 12 02:12:51 2016 (r309865) @@ -1327,6 +1327,7 @@ test_callbacks(void) if (assert((m = archive_match_new()) != NULL)) { archive_entry_free(ae); archive_read_free(a); + archive_match_free(m); return; } Modified: vendor/libarchive/dist/libarchive/test/test_read_set_format.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_set_format.c Mon Dec 12 02:11:30 2016 (r309864) +++ vendor/libarchive/dist/libarchive/test/test_read_set_format.c Mon Dec 12 02:12:51 2016 (r309865) @@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wron /* bunzip2 will write to stderr, redirect it to a file */ fflush(stderr); fgetpos(stderr, &pos); - fd = dup(fileno(stderr)); - fp = freopen("stderr1", "w", stderr); + assert((fd = dup(fileno(stderr))) != -1); + fp = freopen("stderr1", "w", stderr); #endif assert((a = archive_read_new()) != NULL); @@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wron if (fp != NULL) { fflush(stderr); dup2(fd, fileno(stderr)); - close(fd); clearerr(stderr); - fsetpos(stderr, &pos); + (void)fsetpos(stderr, &pos); } + close(fd); assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1"); #endif } From owner-svn-src-vendor@freebsd.org Thu Dec 15 15:35:57 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F802C77AF2; Thu, 15 Dec 2016 15:35:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47CD51E0C; Thu, 15 Dec 2016 15:35:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBFFZu4x066552; Thu, 15 Dec 2016 15:35:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFFZrWW066521; Thu, 15 Dec 2016 15:35:53 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612151535.uBFFZrWW066521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 15 Dec 2016 15:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310115 - in vendor/libarchive/dist: . build build/autoconf cat cpio cpio/test libarchive libarchive/test tar/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2016 15:35:57 -0000 Author: mm Date: Thu Dec 15 15:35:53 2016 New Revision: 310115 URL: https://svnweb.freebsd.org/changeset/base/310115 Log: Update vendor/libarchive to git to 30528ed7a9f479f1c363ee8cfa1c5eb4c7d9be10 Vendor bugfixes: PR 826: OpenSSL 1.1 support PR 830, 831, 833: Spelling fixes OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free() OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives Modified: vendor/libarchive/dist/.travis.yml vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/build/autoconf/config.rpath vendor/libarchive/dist/build/ci_build.sh vendor/libarchive/dist/cat/bsdcat.c vendor/libarchive/dist/configure.ac vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/cpio/test/test_option_lz4.c vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_cryptor.c vendor/libarchive/dist/libarchive/archive_cryptor_private.h vendor/libarchive/dist/libarchive/archive_digest.c vendor/libarchive/dist/libarchive/archive_digest_private.h vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_hmac.c vendor/libarchive/dist/libarchive/archive_hmac_private.h vendor/libarchive/dist/libarchive/archive_options.c vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_append_filter.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_extract2.c vendor/libarchive/dist/libarchive/archive_read_open_memory.c vendor/libarchive/dist/libarchive/archive_read_private.h vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_windows.c vendor/libarchive/dist/libarchive/archive_write.c vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_disk_set_standard_lookup.c vendor/libarchive/dist/libarchive/archive_write_disk_windows.c vendor/libarchive/dist/libarchive/archive_write_open_memory.c vendor/libarchive/dist/libarchive/archive_write_set_format_ar.c vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_shar.c vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c vendor/libarchive/dist/libarchive/archive_write_set_format_v7tar.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c vendor/libarchive/dist/libarchive/test/test_pax_filename_encoding.c vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/tar/test/test_option_lz4.c Modified: vendor/libarchive/dist/.travis.yml ============================================================================== --- vendor/libarchive/dist/.travis.yml Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/.travis.yml Thu Dec 15 15:35:53 2016 (r310115) @@ -1,13 +1,23 @@ language: C sudo: required dist: trusty +os: + - linux + - osx compiler: - gcc - clang env: - BUILD_SYSTEM=cmake - BUILD_SYSTEM=autotools +matrix: + exclude: + - os: osx + compiler: gcc +before_install: + - if [ `uname` = "Darwin" ]; then brew update; fi + - if [ `uname` = "Linux" ]; then sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev liblzo2-dev; fi install: - - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev liblzo2-dev + - if [ `uname` = "Darwin" ]; then brew install xz lzo lz4; fi script: - build/ci_build.sh Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/Makefile.am Thu Dec 15 15:35:53 2016 (r310115) @@ -118,6 +118,8 @@ libarchive_la_SOURCES= \ libarchive/archive_hmac.c \ libarchive/archive_hmac_private.h \ libarchive/archive_match.c \ + libarchive/archive_openssl_evp_private.h \ + libarchive/archive_openssl_hmac_private.h \ libarchive/archive_options.c \ libarchive/archive_options_private.h \ libarchive/archive_pack_dev.h \ Modified: vendor/libarchive/dist/build/autoconf/config.rpath ============================================================================== --- vendor/libarchive/dist/build/autoconf/config.rpath Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/build/autoconf/config.rpath Thu Dec 15 15:35:53 2016 (r310115) @@ -63,7 +63,7 @@ else aix*) wl='-Wl,' ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' @@ -155,7 +155,7 @@ hardcode_direct=no hardcode_minus_L=no case "$host_os" in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -204,7 +204,7 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -354,7 +354,7 @@ else ;; bsdi[45]*) ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -543,7 +543,7 @@ case "$host_os" in bsdi[45]*) library_names_spec='$libname$shrext' ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; Modified: vendor/libarchive/dist/build/ci_build.sh ============================================================================== --- vendor/libarchive/dist/build/ci_build.sh Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/build/ci_build.sh Thu Dec 15 15:35:53 2016 (r310115) @@ -61,7 +61,7 @@ if [ -z "${BUILD_SYSTEM}" ]; then inputerror "Missing type (-t) parameter" fi if [ -z "${BUILDDIR}" ]; then - BUILDDIR="${CURDIR}/BUILD/${BUILD_SYSTEM}" + BUILDDIR="${CURDIR}/build_ci/${BUILD_SYSTEM}" fi mkdir -p "${BUILDDIR}" for action in ${ACTIONS}; do @@ -90,10 +90,7 @@ for action in ${ACTIONS}; do test) case "${BUILD_SYSTEM}" in autotools) - if ! make ${MAKE_ARGS} check; then - cat test-suite.log - exit 1 - fi + make ${MAKE_ARGS} check LOG_DRIVER="${SRCDIR}/build/ci_test_driver" ;; cmake) make ${MAKE_ARGS} test Modified: vendor/libarchive/dist/cat/bsdcat.c ============================================================================== --- vendor/libarchive/dist/cat/bsdcat.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/cat/bsdcat.c Thu Dec 15 15:35:53 2016 (r310115) @@ -142,5 +142,8 @@ main(int argc, char **argv) bsdcat_next(); } + if (a != NULL) + archive_read_free(a); + exit(exit_status); } Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/configure.ac Thu Dec 15 15:35:53 2016 (r310115) @@ -89,7 +89,7 @@ inc_windows_files=no inc_cygwin_files=no case "$host_os" in *mingw* ) inc_windows_files=yes ;; - *cygwin*) inc_cygwin_files=yes ;; + *cygwin* | *msys*) inc_cygwin_files=yes ;; esac AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes]) AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes]) @@ -243,7 +243,7 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test # Set up defines needed before including any headers case $host in - *mingw* | *cygwin* ) + *mingw* | *cygwin* | *msys* ) AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.]) AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.]) AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.]) @@ -302,7 +302,7 @@ AC_ARG_WITH([bz2lib], if test "x$with_bz2lib" != "xno"; then AC_CHECK_HEADERS([bzlib.h]) case "$host_os" in - *mingw* | *cygwin*) + *mingw* | *cygwin* | *msys*) dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore dnl use AC_LINK_IFELSE. AC_MSG_CHECKING([for BZ2_bzDecompressInit in -lbz2]) @@ -797,7 +797,7 @@ main(int argc, char **argv) ]) case "$host_os" in - *mingw* | *cygwin*) + *mingw* | *cygwin* | *msys*) ;; *) CRYPTO_CHECK(MD5, LIBC, md5) @@ -840,7 +840,7 @@ if test "x$with_openssl" != "xno"; then AC_CHECK_HEADERS([openssl/evp.h]) saved_LIBS=$LIBS case "$host_os" in - *mingw* | *cygwin*) + *mingw* | *cygwin* | *msys*) case "$host_cpu" in x86_64) AC_CHECK_LIB(eay64,OPENSSL_config) @@ -886,7 +886,7 @@ if test "x$found_LIBMD" != "xyes"; then fi case "$host_os" in - *mingw* | *cygwin*) + *mingw* | *cygwin* | *msys*) CRYPTO_CHECK_WIN(MD5, CALG_MD5) CRYPTO_CHECK_WIN(SHA1, CALG_SHA1) CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256) Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/cpio/cpio.c Thu Dec 15 15:35:53 2016 (r310115) @@ -1324,10 +1324,9 @@ lookup_name(struct cpio *cpio, struct na if (*name_cache_variable == NULL) { - *name_cache_variable = malloc(sizeof(struct name_cache)); + *name_cache_variable = calloc(1, sizeof(struct name_cache)); if (*name_cache_variable == NULL) lafe_errc(1, ENOMEM, "No more memory"); - memset(*name_cache_variable, 0, sizeof(struct name_cache)); (*name_cache_variable)->size = name_cache_size; } Modified: vendor/libarchive/dist/cpio/test/test_option_lz4.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_lz4.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/cpio/test/test_option_lz4.c Thu Dec 15 15:35:53 2016 (r310115) @@ -63,6 +63,13 @@ DEFINE_TEST(test_option_lz4) "but no such program is available on this system."); return; } + /* On some systems the error won't be detected until closing + time, by a 127 exit error returned by waitpid. */ + if (strstr(p, "Error closing") != NULL && !canLz4()) { + skipping("This version of bsdcpio uses an external lz4 program " + "but no such program is available on this system."); + return; + } failure("--lz4 option is broken: %s", p); assertEqualInt(r, 0); return; Modified: vendor/libarchive/dist/libarchive/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/CMakeLists.txt Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/CMakeLists.txt Thu Dec 15 15:35:53 2016 (r310115) @@ -38,6 +38,8 @@ SET(libarchive_SOURCES archive_hmac.c archive_hmac_private.h archive_match.c + archive_openssl_evp_private.h + archive_openssl_hmac_private.h archive_options.c archive_options_private.h archive_pack_dev.h Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive.h Thu Dec 15 15:35:53 2016 (r310115) @@ -373,7 +373,7 @@ typedef const char *archive_passphrase_c * 4) Repeatedly call archive_read_next_header to get information about * successive archive entries. Call archive_read_data to extract * data for entries of interest. - * 5) Call archive_read_finish to end processing. + * 5) Call archive_read_free to end processing. */ __LA_DECL struct archive *archive_read_new(void); Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_acl.c Thu Dec 15 15:35:53 2016 (r310115) @@ -280,11 +280,17 @@ acl_new_entry(struct archive_acl *acl, acl->acl_text = NULL; } - /* If there's a matching entry already in the list, overwrite it. */ + /* + * If there's a matching entry already in the list, overwrite it. + * NFSv4 entries may be repeated and are not overwritten. + * + * TODO: compare names of no id is provided (needs more rework) + */ ap = acl->acl_head; aq = NULL; while (ap != NULL) { - if (ap->type == type && ap->tag == tag && ap->id == id) { + if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) && + ap->type == type && ap->tag == tag && ap->id == id) { if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER && tag != ARCHIVE_ENTRY_ACL_GROUP)) { ap->permset = permset; @@ -296,10 +302,9 @@ acl_new_entry(struct archive_acl *acl, } /* Add a new entry to the end of the list. */ - ap = (struct archive_acl_entry *)malloc(sizeof(*ap)); + ap = (struct archive_acl_entry *)calloc(1, sizeof(*ap)); if (ap == NULL) return (NULL); - memset(ap, 0, sizeof(*ap)); if (aq == NULL) acl->acl_head = ap; else Modified: vendor/libarchive/dist/libarchive/archive_cryptor.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_cryptor.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_cryptor.c Thu Dec 15 15:35:53 2016 (r310115) @@ -302,6 +302,8 @@ aes_ctr_release(archive_crypto_ctx *ctx) static int aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) { + if ((ctx->ctx = EVP_CIPHER_CTX_new()) == NULL) + return -1; switch (key_len) { case 16: ctx->type = EVP_aes_128_ecb(); break; @@ -314,7 +316,7 @@ aes_ctr_init(archive_crypto_ctx *ctx, co memcpy(ctx->key, key, key_len); memset(ctx->nonce, 0, sizeof(ctx->nonce)); ctx->encr_pos = AES_BLOCK_SIZE; - EVP_CIPHER_CTX_init(&ctx->ctx); + EVP_CIPHER_CTX_init(ctx->ctx); return 0; } @@ -324,10 +326,10 @@ aes_ctr_encrypt_counter(archive_crypto_c int outl = 0; int r; - r = EVP_EncryptInit_ex(&ctx->ctx, ctx->type, NULL, ctx->key, NULL); + r = EVP_EncryptInit_ex(ctx->ctx, ctx->type, NULL, ctx->key, NULL); if (r == 0) return -1; - r = EVP_EncryptUpdate(&ctx->ctx, ctx->encr_buf, &outl, ctx->nonce, + r = EVP_EncryptUpdate(ctx->ctx, ctx->encr_buf, &outl, ctx->nonce, AES_BLOCK_SIZE); if (r == 0 || outl != AES_BLOCK_SIZE) return -1; @@ -337,7 +339,7 @@ aes_ctr_encrypt_counter(archive_crypto_c static int aes_ctr_release(archive_crypto_ctx *ctx) { - EVP_CIPHER_CTX_cleanup(&ctx->ctx); + EVP_CIPHER_CTX_free(ctx->ctx); memset(ctx->key, 0, ctx->key_len); memset(ctx->nonce, 0, sizeof(ctx->nonce)); return 0; Modified: vendor/libarchive/dist/libarchive/archive_cryptor_private.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_cryptor_private.h Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_cryptor_private.h Thu Dec 15 15:35:53 2016 (r310115) @@ -99,12 +99,12 @@ typedef struct { } archive_crypto_ctx; #elif defined(HAVE_LIBCRYPTO) -#include +#include "archive_openssl_evp_private.h" #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 typedef struct { - EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX *ctx; const EVP_CIPHER *type; uint8_t key[AES_MAX_KEY_SIZE]; unsigned key_len; Modified: vendor/libarchive/dist/libarchive/archive_digest.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_digest.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_digest.c Thu Dec 15 15:35:53 2016 (r310115) @@ -207,7 +207,9 @@ __archive_nettle_md5final(archive_md5_ct static int __archive_openssl_md5init(archive_md5_ctx *ctx) { - EVP_DigestInit(ctx, EVP_md5()); + if ((*ctx = EVP_MD_CTX_new()) == NULL) + return (ARCHIVE_FAILED); + EVP_DigestInit(*ctx, EVP_md5()); return (ARCHIVE_OK); } @@ -215,7 +217,7 @@ static int __archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { - EVP_DigestUpdate(ctx, indata, insize); + EVP_DigestUpdate(*ctx, indata, insize); return (ARCHIVE_OK); } @@ -226,8 +228,11 @@ __archive_openssl_md5final(archive_md5_c * this is meant to cope with that. Real fix is probably to fix * archive_write_set_format_xar.c */ - if (ctx->digest) - EVP_DigestFinal(ctx, md, NULL); + if (*ctx) { + EVP_DigestFinal(*ctx, md, NULL); + EVP_MD_CTX_free(*ctx); + *ctx = NULL; + } return (ARCHIVE_OK); } @@ -359,7 +364,9 @@ __archive_nettle_ripemd160final(archive_ static int __archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) { - EVP_DigestInit(ctx, EVP_ripemd160()); + if ((*ctx = EVP_MD_CTX_new()) == NULL) + return (ARCHIVE_FAILED); + EVP_DigestInit(*ctx, EVP_ripemd160()); return (ARCHIVE_OK); } @@ -367,14 +374,18 @@ static int __archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { - EVP_DigestUpdate(ctx, indata, insize); + EVP_DigestUpdate(*ctx, indata, insize); return (ARCHIVE_OK); } static int __archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) { - EVP_DigestFinal(ctx, md, NULL); + if (*ctx) { + EVP_DigestFinal(*ctx, md, NULL); + EVP_MD_CTX_free(*ctx); + *ctx = NULL; + } return (ARCHIVE_OK); } @@ -509,7 +520,9 @@ __archive_nettle_sha1final(archive_sha1_ static int __archive_openssl_sha1init(archive_sha1_ctx *ctx) { - EVP_DigestInit(ctx, EVP_sha1()); + if ((*ctx = EVP_MD_CTX_new()) == NULL) + return (ARCHIVE_FAILED); + EVP_DigestInit(*ctx, EVP_sha1()); return (ARCHIVE_OK); } @@ -517,7 +530,7 @@ static int __archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { - EVP_DigestUpdate(ctx, indata, insize); + EVP_DigestUpdate(*ctx, indata, insize); return (ARCHIVE_OK); } @@ -528,8 +541,11 @@ __archive_openssl_sha1final(archive_sha1 * this is meant to cope with that. Real fix is probably to fix * archive_write_set_format_xar.c */ - if (ctx->digest) - EVP_DigestFinal(ctx, md, NULL); + if (*ctx) { + EVP_DigestFinal(*ctx, md, NULL); + EVP_MD_CTX_free(*ctx); + *ctx = NULL; + } return (ARCHIVE_OK); } @@ -733,7 +749,9 @@ __archive_nettle_sha256final(archive_sha static int __archive_openssl_sha256init(archive_sha256_ctx *ctx) { - EVP_DigestInit(ctx, EVP_sha256()); + if ((*ctx = EVP_MD_CTX_new()) == NULL) + return (ARCHIVE_FAILED); + EVP_DigestInit(*ctx, EVP_sha256()); return (ARCHIVE_OK); } @@ -741,14 +759,18 @@ static int __archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { - EVP_DigestUpdate(ctx, indata, insize); + EVP_DigestUpdate(*ctx, indata, insize); return (ARCHIVE_OK); } static int __archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md) { - EVP_DigestFinal(ctx, md, NULL); + if (*ctx) { + EVP_DigestFinal(*ctx, md, NULL); + EVP_MD_CTX_free(*ctx); + *ctx = NULL; + } return (ARCHIVE_OK); } @@ -928,7 +950,9 @@ __archive_nettle_sha384final(archive_sha static int __archive_openssl_sha384init(archive_sha384_ctx *ctx) { - EVP_DigestInit(ctx, EVP_sha384()); + if ((*ctx = EVP_MD_CTX_new()) == NULL) + return (ARCHIVE_FAILED); + EVP_DigestInit(*ctx, EVP_sha384()); return (ARCHIVE_OK); } @@ -936,14 +960,18 @@ static int __archive_openssl_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { - EVP_DigestUpdate(ctx, indata, insize); + EVP_DigestUpdate(*ctx, indata, insize); return (ARCHIVE_OK); } static int __archive_openssl_sha384final(archive_sha384_ctx *ctx, void *md) { - EVP_DigestFinal(ctx, md, NULL); + if (*ctx) { + EVP_DigestFinal(*ctx, md, NULL); + EVP_MD_CTX_free(*ctx); + *ctx = NULL; + } return (ARCHIVE_OK); } @@ -1147,7 +1175,9 @@ __archive_nettle_sha512final(archive_sha static int __archive_openssl_sha512init(archive_sha512_ctx *ctx) { - EVP_DigestInit(ctx, EVP_sha512()); + if ((*ctx = EVP_MD_CTX_new()) == NULL) + return (ARCHIVE_FAILED); + EVP_DigestInit(*ctx, EVP_sha512()); return (ARCHIVE_OK); } @@ -1155,14 +1185,18 @@ static int __archive_openssl_sha512update(archive_sha512_ctx *ctx, const void *indata, size_t insize) { - EVP_DigestUpdate(ctx, indata, insize); + EVP_DigestUpdate(*ctx, indata, insize); return (ARCHIVE_OK); } static int __archive_openssl_sha512final(archive_sha512_ctx *ctx, void *md) { - EVP_DigestFinal(ctx, md, NULL); + if (*ctx) { + EVP_DigestFinal(*ctx, md, NULL); + EVP_MD_CTX_free(*ctx); + *ctx = NULL; + } return (ARCHIVE_OK); } Modified: vendor/libarchive/dist/libarchive/archive_digest_private.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_digest_private.h Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_digest_private.h Thu Dec 15 15:35:53 2016 (r310115) @@ -134,7 +134,7 @@ defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) #define ARCHIVE_CRYPTO_OPENSSL 1 -#include +#include "archive_openssl_evp_private.h" #endif /* Windows crypto headers */ @@ -161,7 +161,7 @@ typedef CC_MD5_CTX archive_md5_ctx; #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) typedef struct md5_ctx archive_md5_ctx; #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) -typedef EVP_MD_CTX archive_md5_ctx; +typedef EVP_MD_CTX *archive_md5_ctx; #elif defined(ARCHIVE_CRYPTO_MD5_WIN) typedef Digest_CTX archive_md5_ctx; #else @@ -175,7 +175,7 @@ typedef RIPEMD160_CTX archive_rmd160_ctx #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) typedef struct ripemd160_ctx archive_rmd160_ctx; #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) -typedef EVP_MD_CTX archive_rmd160_ctx; +typedef EVP_MD_CTX *archive_rmd160_ctx; #else typedef unsigned char archive_rmd160_ctx; #endif @@ -189,7 +189,7 @@ typedef CC_SHA1_CTX archive_sha1_ctx; #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) typedef struct sha1_ctx archive_sha1_ctx; #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) -typedef EVP_MD_CTX archive_sha1_ctx; +typedef EVP_MD_CTX *archive_sha1_ctx; #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) typedef Digest_CTX archive_sha1_ctx; #else @@ -209,7 +209,7 @@ typedef CC_SHA256_CTX archive_sha256_ctx #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) typedef struct sha256_ctx archive_sha256_ctx; #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) -typedef EVP_MD_CTX archive_sha256_ctx; +typedef EVP_MD_CTX *archive_sha256_ctx; #elif defined(ARCHIVE_CRYPTO_SHA256_WIN) typedef Digest_CTX archive_sha256_ctx; #else @@ -227,7 +227,7 @@ typedef CC_SHA512_CTX archive_sha384_ctx #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE) typedef struct sha384_ctx archive_sha384_ctx; #elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) -typedef EVP_MD_CTX archive_sha384_ctx; +typedef EVP_MD_CTX *archive_sha384_ctx; #elif defined(ARCHIVE_CRYPTO_SHA384_WIN) typedef Digest_CTX archive_sha384_ctx; #else @@ -247,7 +247,7 @@ typedef CC_SHA512_CTX archive_sha512_ctx #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE) typedef struct sha512_ctx archive_sha512_ctx; #elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) -typedef EVP_MD_CTX archive_sha512_ctx; +typedef EVP_MD_CTX *archive_sha512_ctx; #elif defined(ARCHIVE_CRYPTO_SHA512_WIN) typedef Digest_CTX archive_sha512_ctx; #else Modified: vendor/libarchive/dist/libarchive/archive_entry.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_entry.c Thu Dec 15 15:35:53 2016 (r310115) @@ -248,10 +248,9 @@ archive_entry_new2(struct archive *a) { struct archive_entry *entry; - entry = (struct archive_entry *)malloc(sizeof(*entry)); + entry = (struct archive_entry *)calloc(1, sizeof(*entry)); if (entry == NULL) return (NULL); - memset(entry, 0, sizeof(*entry)); entry->archive = a; return (entry); } Modified: vendor/libarchive/dist/libarchive/archive_hmac.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_hmac.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_hmac.c Thu Dec 15 15:35:53 2016 (r310115) @@ -176,8 +176,10 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ct static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { - HMAC_CTX_init(ctx); - HMAC_Init(ctx, key, key_len, EVP_sha1()); + *ctx = HMAC_CTX_new(); + if (*ctx == NULL) + return -1; + HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL); return 0; } @@ -185,22 +187,22 @@ static void __hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data, size_t data_len) { - HMAC_Update(ctx, data, data_len); + HMAC_Update(*ctx, data, data_len); } static void __hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len) { unsigned int len = (unsigned int)*out_len; - HMAC_Final(ctx, out, &len); + HMAC_Final(*ctx, out, &len); *out_len = len; } static void __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) { - HMAC_CTX_cleanup(ctx); - memset(ctx, 0, sizeof(*ctx)); + HMAC_CTX_free(*ctx); + *ctx = NULL; } #else Modified: vendor/libarchive/dist/libarchive/archive_hmac_private.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_hmac_private.h Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_hmac_private.h Thu Dec 15 15:35:53 2016 (r310115) @@ -70,9 +70,9 @@ typedef struct { typedef struct hmac_sha1_ctx archive_hmac_sha1_ctx; #elif defined(HAVE_LIBCRYPTO) -#include +#include "archive_openssl_hmac_private.h" -typedef HMAC_CTX archive_hmac_sha1_ctx; +typedef HMAC_CTX* archive_hmac_sha1_ctx; #else Modified: vendor/libarchive/dist/libarchive/archive_options.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_options.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_options.c Thu Dec 15 15:35:53 2016 (r310115) @@ -26,6 +26,10 @@ #include "archive_platform.h" __FBSDID("$FreeBSD$"); +#ifdef HAVE_ERRNO_H +#include +#endif + #include "archive_options_private.h" static const char * @@ -105,8 +109,11 @@ _archive_set_options(struct archive *a, if (options == NULL || options[0] == '\0') return ARCHIVE_OK; - data = (char *)malloc(strlen(options) + 1); - strcpy(data, options); + if ((data = strdup(options)) == NULL) { + archive_set_error(a, + ENOMEM, "Out of memory adding file to list"); + return (ARCHIVE_FATAL); + } s = (const char *)data; do { Modified: vendor/libarchive/dist/libarchive/archive_read.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read.c Thu Dec 15 15:35:53 2016 (r310115) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/ static int choose_filters(struct archive_read *); static int choose_format(struct archive_read *); +static int close_filters(struct archive_read *); static struct archive_vtable *archive_read_vtable(void); static int64_t _archive_filter_bytes(struct archive *, int); static int _archive_filter_code(struct archive *, int); @@ -528,7 +529,7 @@ archive_read_open1(struct archive *_a) { slot = choose_format(a); if (slot < 0) { - __archive_read_close_filters(a); + close_filters(a); a->archive.state = ARCHIVE_STATE_FATAL; return (ARCHIVE_FATAL); } @@ -582,7 +583,6 @@ choose_filters(struct archive_read *a) /* Verify the filter by asking it for some data. */ __archive_read_filter_ahead(a->filter, 1, &avail); if (avail < 0) { - __archive_read_close_filters(a); __archive_read_free_filters(a); return (ARCHIVE_FATAL); } @@ -601,7 +601,6 @@ choose_filters(struct archive_read *a) a->filter = filter; r = (best_bidder->init)(a->filter); if (r != ARCHIVE_OK) { - __archive_read_close_filters(a); __archive_read_free_filters(a); return (ARCHIVE_FATAL); } @@ -986,8 +985,8 @@ _archive_read_data_block(struct archive return (a->format->read_data)(a, buff, size, offset); } -int -__archive_read_close_filters(struct archive_read *a) +static int +close_filters(struct archive_read *a) { struct archive_read_filter *f = a->filter; int r = ARCHIVE_OK; @@ -1010,6 +1009,9 @@ __archive_read_close_filters(struct arch void __archive_read_free_filters(struct archive_read *a) { + /* Make sure filters are closed and their buffers are freed */ + close_filters(a); + while (a->filter != NULL) { struct archive_read_filter *t = a->filter->upstream; free(a->filter); @@ -1052,7 +1054,7 @@ _archive_read_close(struct archive *_a) /* TODO: Clean up the formatters. */ /* Release the filter objects. */ - r1 = __archive_read_close_filters(a); + r1 = close_filters(a); if (r1 < r) r = r1; Modified: vendor/libarchive/dist/libarchive/archive_read_append_filter.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_append_filter.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_append_filter.c Thu Dec 15 15:35:53 2016 (r310115) @@ -133,7 +133,6 @@ archive_read_append_filter(struct archiv a->filter = filter; r2 = (bidder->init)(a->filter); if (r2 != ARCHIVE_OK) { - __archive_read_close_filters(a); __archive_read_free_filters(a); return (ARCHIVE_FATAL); } @@ -191,7 +190,6 @@ archive_read_append_filter_program_signa a->filter = filter; r = (bidder->init)(a->filter); if (r != ARCHIVE_OK) { - __archive_read_close_filters(a); __archive_read_free_filters(a); return (ARCHIVE_FATAL); } Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Thu Dec 15 15:35:53 2016 (r310115) @@ -244,7 +244,7 @@ struct tree { int initial_filesystem_id; int current_filesystem_id; int max_filesystem_id; - int allocated_filesytem; + int allocated_filesystem; int entry_fd; int entry_eof; @@ -1382,7 +1382,7 @@ update_current_filesystem(struct archive for (i = 0; i < t->max_filesystem_id; i++) { if (t->filesystem_table[i].dev == dev) { - /* There is the filesytem ID we've already generated. */ + /* There is the filesystem ID we've already generated. */ t->current_filesystem_id = i; t->current_filesystem = &(t->filesystem_table[i]); return (ARCHIVE_OK); @@ -1390,10 +1390,10 @@ update_current_filesystem(struct archive } /* - * This is the new filesytem which we have to generate a new ID for. + * This is the new filesystem which we have to generate a new ID for. */ fid = t->max_filesystem_id++; - if (t->max_filesystem_id > t->allocated_filesytem) { + if (t->max_filesystem_id > t->allocated_filesystem) { size_t s; void *p; @@ -1406,7 +1406,7 @@ update_current_filesystem(struct archive return (ARCHIVE_FATAL); } t->filesystem_table = (struct filesystem *)p; - t->allocated_filesytem = s; + t->allocated_filesystem = s; } t->current_filesystem_id = fid; t->current_filesystem = &(t->filesystem_table[fid]); @@ -2063,8 +2063,7 @@ tree_push(struct tree *t, const char *pa { struct tree_entry *te; - te = malloc(sizeof(*te)); - memset(te, 0, sizeof(*te)); + te = calloc(1, sizeof(*te)); te->next = t->stack; te->parent = t->current; if (te->parent) @@ -2122,9 +2121,8 @@ tree_open(const char *path, int symlink_ { struct tree *t; - if ((t = malloc(sizeof(*t))) == NULL) + if ((t = calloc(1, sizeof(*t))) == NULL) return (NULL); - memset(t, 0, sizeof(*t)); archive_string_init(&t->path); archive_string_ensure(&t->path, 31); t->initial_symlink_mode = symlink_mode; Modified: vendor/libarchive/dist/libarchive/archive_read_disk_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Thu Dec 15 15:35:53 2016 (r310115) @@ -168,7 +168,7 @@ struct tree { int initial_filesystem_id; int current_filesystem_id; int max_filesystem_id; - int allocated_filesytem; + int allocated_filesystem; HANDLE entry_fh; int entry_eof; @@ -389,10 +389,9 @@ archive_read_disk_new(void) { struct archive_read_disk *a; - a = (struct archive_read_disk *)malloc(sizeof(*a)); + a = (struct archive_read_disk *)calloc(1, sizeof(*a)); if (a == NULL) return (NULL); - memset(a, 0, sizeof(*a)); a->archive.magic = ARCHIVE_READ_DISK_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; a->archive.vtable = archive_read_disk_vtable(); @@ -1261,7 +1260,7 @@ update_current_filesystem(struct archive for (i = 0; i < t->max_filesystem_id; i++) { if (t->filesystem_table[i].dev == dev) { - /* There is the filesytem ID we've already generated. */ + /* There is the filesystem ID we've already generated. */ t->current_filesystem_id = i; t->current_filesystem = &(t->filesystem_table[i]); return (ARCHIVE_OK); @@ -1269,10 +1268,10 @@ update_current_filesystem(struct archive } /* - * There is a new filesytem, we generate a new ID for. + * There is a new filesystem, we generate a new ID for. */ fid = t->max_filesystem_id++; - if (t->max_filesystem_id > t->allocated_filesytem) { + if (t->max_filesystem_id > t->allocated_filesystem) { size_t s; void *p; @@ -1285,7 +1284,7 @@ update_current_filesystem(struct archive return (ARCHIVE_FATAL); } t->filesystem_table = (struct filesystem *)p; - t->allocated_filesytem = (int)s; + t->allocated_filesystem = (int)s; } t->current_filesystem_id = fid; t->current_filesystem = &(t->filesystem_table[fid]); @@ -1437,8 +1436,7 @@ tree_push(struct tree *t, const wchar_t { struct tree_entry *te; - te = malloc(sizeof(*te)); - memset(te, 0, sizeof(*te)); + te = calloc(1, sizeof(*te)); te->next = t->stack; te->parent = t->current; if (te->parent) @@ -1507,8 +1505,7 @@ tree_open(const wchar_t *path, int symli { struct tree *t; - t = malloc(sizeof(*t)); - memset(t, 0, sizeof(*t)); + t = calloc(1, sizeof(*t)); archive_string_init(&(t->full_path)); archive_string_init(&t->path); archive_wstring_ensure(&t->path, 15); Modified: vendor/libarchive/dist/libarchive/archive_read_extract2.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_extract2.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_extract2.c Thu Dec 15 15:35:53 2016 (r310115) @@ -52,12 +52,11 @@ struct archive_read_extract * __archive_read_get_extract(struct archive_read *a) { if (a->extract == NULL) { - a->extract = (struct archive_read_extract *)malloc(sizeof(*a->extract)); + a->extract = (struct archive_read_extract *)calloc(1, sizeof(*a->extract)); if (a->extract == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't extract"); return (NULL); } - memset(a->extract, 0, sizeof(*a->extract)); a->cleanup_archive_extract = archive_read_extract_cleanup; } return (a->extract); Modified: vendor/libarchive/dist/libarchive/archive_read_open_memory.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_open_memory.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_open_memory.c Thu Dec 15 15:35:53 2016 (r310115) @@ -70,12 +70,11 @@ archive_read_open_memory2(struct archive { struct read_memory_data *mine; - mine = (struct read_memory_data *)malloc(sizeof(*mine)); + mine = (struct read_memory_data *)calloc(1, sizeof(*mine)); if (mine == NULL) { archive_set_error(a, ENOMEM, "No memory"); return (ARCHIVE_FATAL); } - memset(mine, 0, sizeof(*mine)); mine->start = mine->p = (const unsigned char *)buff; mine->end = mine->start + size; mine->read_size = read_size; Modified: vendor/libarchive/dist/libarchive/archive_read_private.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_private.h Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_private.h Thu Dec 15 15:35:53 2016 (r310115) @@ -252,7 +252,6 @@ int64_t __archive_read_consume(struct ar int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); int __archive_read_program(struct archive_read_filter *, const char *); void __archive_read_free_filters(struct archive_read *); -int __archive_read_close_filters(struct archive_read *); struct archive_read_extract *__archive_read_get_extract(struct archive_read *); Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c Thu Dec 15 15:35:53 2016 (r310115) @@ -320,30 +320,14 @@ uudecode_bidder_bid(struct archive_read_ if (l > 45) /* Normally, maximum length is 45(character 'M'). */ return (0); - while (l && len-nl > 0) { - if (l > 0) { - if (!uuchar[*b++]) - return (0); - if (!uuchar[*b++]) - return (0); - len -= 2; - --l; - } - if (l > 0) { - if (!uuchar[*b++]) - return (0); - --len; - --l; - } - if (l > 0) { - if (!uuchar[*b++]) - return (0); - --len; - --l; - } + if (l > len - nl) + return (0); /* Line too short. */ + while (l) { + if (!uuchar[*b++]) + return (0); + --len; + --l; } - if (len-nl < 0) - return (0); if (len-nl == 1 && (uuchar[*b] || /* Check sum. */ (*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */ Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Thu Dec 15 15:35:53 2016 (r310115) @@ -213,7 +213,7 @@ struct _7zip { int header_is_encoded; uint64_t header_bytes_remaining; unsigned long header_crc32; - /* Header offset to check that reading pointes of the file contens + /* Header offset to check that reading points of the file contents * will not exceed the header. */ uint64_t header_offset; /* Base offset of the archive file for a seek in case reading SFX. */ Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c Thu Dec 15 15:14:02 2016 (r310114) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c Thu Dec 15 15:35:53 2016 (r310115) @@ -104,13 +104,12 @@ archive_read_support_format_ar(struct ar archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_support_format_ar"); - ar = (struct ar *)malloc(sizeof(*ar)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:13:50 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12952C83548; Fri, 16 Dec 2016 18:13:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCEF1323; Fri, 16 Dec 2016 18:13:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIDmDN022071; Fri, 16 Dec 2016 18:13:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIDm7n022070; Fri, 16 Dec 2016 18:13:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161813.uBGIDm7n022070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310161 - vendor/llvm/llvm-release_391-r289601 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:13:50 -0000 Author: dim Date: Fri Dec 16 18:13:48 2016 New Revision: 310161 URL: https://svnweb.freebsd.org/changeset/base/310161 Log: Tag llvm 3.9.1 release r289601. Added: vendor/llvm/llvm-release_391-r289601/ - copied from r310160, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:14:05 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 442ECC8357C; Fri, 16 Dec 2016 18:14:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1367B634; Fri, 16 Dec 2016 18:14:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIE4Pl022136; Fri, 16 Dec 2016 18:14:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIE4fx022135; Fri, 16 Dec 2016 18:14:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161814.uBGIE4fx022135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310162 - vendor/clang/dist/lib/Basic X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:14:05 -0000 Author: dim Date: Fri Dec 16 18:14:04 2016 New Revision: 310162 URL: https://svnweb.freebsd.org/changeset/base/310162 Log: Vendor import of clang 3.9.1 release r289601: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_391/final@289601 Modified: vendor/clang/dist/lib/Basic/Version.cpp Modified: vendor/clang/dist/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Version.cpp Fri Dec 16 18:13:48 2016 (r310161) +++ vendor/clang/dist/lib/Basic/Version.cpp Fri Dec 16 18:14:04 2016 (r310162) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_39/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_391/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:14:08 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25AB9C835A3; Fri, 16 Dec 2016 18:14:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB75467D; Fri, 16 Dec 2016 18:14:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIE6HF022182; Fri, 16 Dec 2016 18:14:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIE6Jo022181; Fri, 16 Dec 2016 18:14:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161814.uBGIE6Jo022181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310163 - vendor/clang/clang-release_391-r289601 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:14:08 -0000 Author: dim Date: Fri Dec 16 18:14:06 2016 New Revision: 310163 URL: https://svnweb.freebsd.org/changeset/base/310163 Log: Tag clang 3.9.1 release r289601. Added: vendor/clang/clang-release_391-r289601/ - copied from r310162, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:14:14 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38566C835E1; Fri, 16 Dec 2016 18:14:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E359D77B; Fri, 16 Dec 2016 18:14:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIEDQF022231; Fri, 16 Dec 2016 18:14:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIEDaT022230; Fri, 16 Dec 2016 18:14:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161814.uBGIEDaT022230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310164 - vendor/compiler-rt/compiler-rt-release_391-r289601 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:14:14 -0000 Author: dim Date: Fri Dec 16 18:14:12 2016 New Revision: 310164 URL: https://svnweb.freebsd.org/changeset/base/310164 Log: Tag compiler-rt 3.9.1 release r289601. Added: vendor/compiler-rt/compiler-rt-release_391-r289601/ - copied from r310163, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:14:24 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E39EC83635; Fri, 16 Dec 2016 18:14:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05D92888; Fri, 16 Dec 2016 18:14:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIENrd022280; Fri, 16 Dec 2016 18:14:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIEN9f022279; Fri, 16 Dec 2016 18:14:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161814.uBGIEN9f022279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310165 - vendor/libc++/libc++-release_391-r289601 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:14:24 -0000 Author: dim Date: Fri Dec 16 18:14:23 2016 New Revision: 310165 URL: https://svnweb.freebsd.org/changeset/base/310165 Log: Tag libc++ 3.9.1 release r289601. Added: vendor/libc++/libc++-release_391-r289601/ - copied from r310164, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:14:28 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29382C83655; Fri, 16 Dec 2016 18:14:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4AC28EA; Fri, 16 Dec 2016 18:14:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIERhD022329; Fri, 16 Dec 2016 18:14:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIERKL022328; Fri, 16 Dec 2016 18:14:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161814.uBGIERKL022328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310166 - vendor/lld/lld-release_391-r289601 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:14:28 -0000 Author: dim Date: Fri Dec 16 18:14:26 2016 New Revision: 310166 URL: https://svnweb.freebsd.org/changeset/base/310166 Log: Tag lld 3.9.1 release r289601. Added: vendor/lld/lld-release_391-r289601/ - copied from r310165, vendor/lld/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 16 18:14:37 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 848ADC836B7; Fri, 16 Dec 2016 18:14:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C04B9FC; Fri, 16 Dec 2016 18:14:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGIEaFT022378; Fri, 16 Dec 2016 18:14:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIEaCh022377; Fri, 16 Dec 2016 18:14:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612161814.uBGIEaCh022377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Dec 2016 18:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310167 - vendor/lldb/lldb-release_391-r289601 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 18:14:37 -0000 Author: dim Date: Fri Dec 16 18:14:36 2016 New Revision: 310167 URL: https://svnweb.freebsd.org/changeset/base/310167 Log: Tag lldb 3.9.1 release r289601. Added: vendor/lldb/lldb-release_391-r289601/ - copied from r310166, vendor/lldb/dist/ From owner-svn-src-vendor@freebsd.org Sat Dec 17 02:01:07 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B07BC82FF0; Sat, 17 Dec 2016 02:01:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9E2F194C; Sat, 17 Dec 2016 02:01:06 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBH2164k011420; Sat, 17 Dec 2016 02:01:06 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH215fV011417; Sat, 17 Dec 2016 02:01:05 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612170201.uBH215fV011417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 17 Dec 2016 02:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310184 - in vendor/libarchive/dist: build libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2016 02:01:07 -0000 Author: mm Date: Sat Dec 17 02:01:05 2016 New Revision: 310184 URL: https://svnweb.freebsd.org/changeset/base/310184 Log: Add vendor/libarchive/dist files missing in r310115 Added: vendor/libarchive/dist/build/ci_test_driver (contents, props changed) vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h (contents, props changed) Added: vendor/libarchive/dist/build/ci_test_driver ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci_test_driver Sat Dec 17 02:01:05 2016 (r310184) @@ -0,0 +1,148 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: Added: vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h Sat Dec 17 02:01:05 2016 (r310184) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED +#define ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED + +#include +#include + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#include /* malloc, free */ +#include /* memset */ +static inline EVP_MD_CTX *EVP_MD_CTX_new(void) +{ + EVP_MD_CTX *ctx = (EVP_MD_CTX *)calloc(1, sizeof(EVP_MD_CTX)); + return ctx; +} + +static inline void EVP_MD_CTX_free(EVP_MD_CTX *ctx) +{ + EVP_MD_CTX_cleanup(ctx); + memset(ctx, 0, sizeof(*ctx)); + free(ctx); +} +#endif + +#endif Added: vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h Sat Dec 17 02:01:05 2016 (r310184) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED +#define ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED + +#include +#include + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#include /* malloc, free */ +#include /* memset */ +static inline HMAC_CTX *HMAC_CTX_new(void) +{ + HMAC_CTX *ctx = (HMAC_CTX *)calloc(1, sizeof(HMAC_CTX)); + return ctx; +} + +static inline void HMAC_CTX_free(HMAC_CTX *ctx) +{ + HMAC_CTX_cleanup(ctx); + memset(ctx, 0, sizeof(*ctx)); + free(ctx); +} +#endif + +#endif