summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_read.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-20 15:36:18 (GMT)
committerBrad King <brad.king@kitware.com>2017-07-20 15:36:18 (GMT)
commit6df1bda1c57193b289866389a994ea79a2f5e1d8 (patch)
tree7bf31a5dc1702e7a0faebe654da69f5c5eaeca90 /Utilities/cmlibarchive/libarchive/archive_read.c
parentb6674431af4790ba5deea9e5e6bd7b2620beb69e (diff)
parent11f3dcb04887fccf38a8eda19d498bf7a5060486 (diff)
downloadCMake-6df1bda1c57193b289866389a994ea79a2f5e1d8.zip
CMake-6df1bda1c57193b289866389a994ea79a2f5e1d8.tar.gz
CMake-6df1bda1c57193b289866389a994ea79a2f5e1d8.tar.bz2
Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive: LibArchive 2017-07-09 (98a69539)
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_read.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read.c b/Utilities/cmlibarchive/libarchive/archive_read.c
index d1feceb..a642a33 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read.c
@@ -881,7 +881,8 @@ archive_read_data(struct archive *_a, void *buff, size_t s)
len = a->read_data_remaining;
if (len > s)
len = s;
- memcpy(dest, a->read_data_block, len);
+ if (len)
+ memcpy(dest, a->read_data_block, len);
s -= len;
a->read_data_block += len;
a->read_data_remaining -= len;