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 5ae09b626cbc..554533ecb91b 100644
--- a/libarchive/archive_string.c
+++ b/libarchive/archive_string.c
@@ -214,7 +214,8 @@ archive_wstring_append(struct archive_wstring *as, const wchar_t *p, size_t s)
{
if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
return (NULL);
- wmemmove(as->s + as->length, p, s);
+ if (s)
+ wmemmove(as->s + as->length, p, s);
as->length += s;
as->s[as->length] = 0;
return (as);