summaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/archive_write_set_format_pax.c
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2017-01-02 01:43:11 +0000
committermm <mm@FreeBSD.org>2017-01-02 01:43:11 +0000
commitdf4798dc9511aa38aa412b763161b0927b955e11 (patch)
tree72d16a8900f63c42d2726f774bed694dfaa3a2ee /contrib/libarchive/libarchive/archive_write_set_format_pax.c
parentcd9bc4aa8c26fc251bae744bd07deff7f250e0b9 (diff)
downloadFreeBSD-src-df4798dc9511aa38aa412b763161b0927b955e11.zip
FreeBSD-src-df4798dc9511aa38aa412b763161b0927b955e11.tar.gz
MFC r309300,r309363,r309405,r309523,r309590,r310185,r310623:
Sync libarchive with vendor. Fixed vendor issues (relevant to FreeBSD) #825, #832: Add sanity check of tar "uid, "gid" and "mtime" fields #830, #831, #833, #846: Spelling fixes #850: Fix issues with reading certain jar files Fixed issues found by Google OSS-Fuzz: OSS-Fuzz #15: Fix heap-buffer-overflow in archive_le16dec() OSS-Fuzz #16: Fix possible hang in uudecode_filter_read() OSS-Fuzz #139, #145, #152: Fix heap-buffer-overflow in uudecode_bidder_bid() OSS-Fuzz #220: Reject an 'ar' filename table larger than 1GB or a filename larger than 1MB 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 OSS-Fuzz #286: Bugfix in archive_strncat_l() More information: https://github.com/libarchive/libarchive/issues/[libarchive_issue_number] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=[oss_fuzz_issue_number]
Diffstat (limited to 'contrib/libarchive/libarchive/archive_write_set_format_pax.c')
-rw-r--r--contrib/libarchive/libarchive/archive_write_set_format_pax.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/libarchive/libarchive/archive_write_set_format_pax.c b/contrib/libarchive/libarchive/archive_write_set_format_pax.c
index 1f3e5ad..786eec4 100644
--- a/contrib/libarchive/libarchive/archive_write_set_format_pax.c
+++ b/contrib/libarchive/libarchive/archive_write_set_format_pax.c
@@ -127,13 +127,12 @@ archive_write_set_format_pax(struct archive *_a)
if (a->format_free != NULL)
(a->format_free)(a);
- pax = (struct pax *)malloc(sizeof(*pax));
+ pax = (struct pax *)calloc(1, sizeof(*pax));
if (pax == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate pax data");
return (ARCHIVE_FATAL);
}
- memset(pax, 0, sizeof(*pax));
a->format_data = pax;
a->format_name = "pax";
a->format_options = archive_write_pax_options;
@@ -709,7 +708,7 @@ archive_write_pax_header(struct archive_write *a,
/* Copy entry so we can modify it as needed. */
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry_original);
if (entry_main == entry_original)
OpenPOWER on IntegriCloud