aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/archive_write_open_memory.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2017-01-02 01:43:11 +0000
committerMartin Matuska <mm@FreeBSD.org>2017-01-02 01:43:11 +0000
commit895fbdfa5955f54455198980ba5a0fd9bacc49f5 (patch)
tree72d16a8900f63c42d2726f774bed694dfaa3a2ee /contrib/libarchive/libarchive/archive_write_open_memory.c
parentd7de25725cf10e1f649ddd32b664ce7b2aedca3c (diff)
downloadsrc-895fbdfa5955f54455198980ba5a0fd9bacc49f5.tar.gz
src-895fbdfa5955f54455198980ba5a0fd9bacc49f5.zip
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]
Notes
Notes: svn path=/stable/10/; revision=311042
Diffstat (limited to 'contrib/libarchive/libarchive/archive_write_open_memory.c')
-rw-r--r--contrib/libarchive/libarchive/archive_write_open_memory.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/libarchive/libarchive/archive_write_open_memory.c b/contrib/libarchive/libarchive/archive_write_open_memory.c
index e9e1e29ea73e..8c274f76c619 100644
--- a/contrib/libarchive/libarchive/archive_write_open_memory.c
+++ b/contrib/libarchive/libarchive/archive_write_open_memory.c
@@ -53,12 +53,11 @@ archive_write_open_memory(struct archive *a, void *buff, size_t buffSize, size_t
{
struct write_memory_data *mine;
- mine = (struct write_memory_data *)malloc(sizeof(*mine));
+ mine = (struct write_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->buff = buff;
mine->size = buffSize;
mine->client_size = used;