path: root/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
diff options
authorMartin Matuska <mm@FreeBSD.org>2020-02-19 01:51:44 +0000
committerMartin Matuska <mm@FreeBSD.org>2020-02-19 01:51:44 +0000
commit55f1ebd2ad2abb6260da67519c51b42de7b99c27 (patch)
tree86fbbb9a023c251afdd91aa0efd6d12554656a3a /contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
parentc73f11781d78f9e268f4f63a6e39ca641b4d709b (diff)
MFC r356212,r356366,r356416,r357785
Update libarchive to version 3.4.2 Relevant vendor changes (r356212): Issue #351: Refactor and implement private state logic for write filters PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482) PR #1255: zip writer - don't append unused NUL for directories PR #1260: Fix sparse file offset overflow on 32-bit systems PR #1263: UNICODE filename support for reading lha/lzh format Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs() PR #1288: Add the "xattrhdr" option to pax write options PR #1295: 7z reader - fix reading archives with digests in PackInfo PR #1296: RAR5 reader - verify window size for multivolume archives PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs() OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error Fix possible off-by-one when dealing with readlink(2) Relevant vendor changes (r356366): Issue #1302: Plug memory leak on failure of archive_write_client_open() Relevant vendor changes (r356416): Issue #1302: Re-do fix for archive_write_client_open() Relevant vendor changes (r357785): PR #1289: atomic extraction support (bsdtar -x --safe-writes) PR #1308: big endian fix for UTF16 support in LHA reader PR #1326: reject RAR5 files that declare invalid header flags Issue #987: fix support 7z archive entries with Delta filter Issue #1317: fix compression output buffer handling in XAR writer Issue #1319: fix uname or gname longer than 32 characters in pax writer Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR Use localtime_r() and gmtime_r() instead of localtime() and gmtime()
Notes: svn path=/stable/10/; revision=358090
Diffstat (limited to 'contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c b/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
index 45417e9ac763..2a8cec8d1178 100644
--- a/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
+++ b/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
@@ -249,11 +249,11 @@ archive_read_disk_entry_from_file(struct archive *_a,
#if defined(HAVE_READLINK) || defined(HAVE_READLINKAT)
if (S_ISLNK(st->st_mode)) {
- size_t linkbuffer_len = st->st_size + 1;
+ size_t linkbuffer_len = st->st_size;
char *linkbuffer;
int lnklen;
- linkbuffer = malloc(linkbuffer_len);
+ linkbuffer = malloc(linkbuffer_len + 1);
if (linkbuffer == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Couldn't read link data");
@@ -280,7 +280,7 @@ archive_read_disk_entry_from_file(struct archive *_a,
- linkbuffer[lnklen] = 0;
+ linkbuffer[lnklen] = '\0';
archive_entry_set_symlink(entry, linkbuffer);