aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_read.c')
-rw-r--r--libarchive/archive_read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c
index d1fecebfd09f..a642a336def6 100644
--- a/libarchive/archive_read.c
+++ b/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;