aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_string.c')
-rw-r--r--libarchive/archive_string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
index 592ead2bdd58..5ae09b626cbc 100644
--- a/libarchive/archive_string.c
+++ b/libarchive/archive_string.c
@@ -202,7 +202,8 @@ archive_string_append(struct archive_string *as, const char *p, size_t s)
{
if (archive_string_ensure(as, as->length + s + 1) == NULL)
return (NULL);
- memmove(as->s + as->length, p, s);
+ if (s)
+ memmove(as->s + as->length, p, s);
as->length += s;
as->s[as->length] = 0;
return (as);