]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Short cut zero size to avoid notnull attribute for mmemove in glibc.
authorJoerg Sonnenberger <joerg@bec.de>
Fri, 28 Apr 2017 21:32:32 +0000 (23:32 +0200)
committerJoerg Sonnenberger <joerg@bec.de>
Fri, 28 Apr 2017 21:32:32 +0000 (23:32 +0200)
Reported-By: OSS-Fuzz issue 497

libarchive/archive_string.c

index 592ead2bdd58bc7d6346ce814f07eca9b57b047c..ca39c069ab61ebcb261da821eb8c013452679a40 100644 (file)
@@ -200,6 +200,8 @@ static int archive_string_append_unicode(struct archive_string *,
 static struct archive_string *
 archive_string_append(struct archive_string *as, const char *p, size_t s)
 {
+       if (s == 0)
+               return (as);
        if (archive_string_ensure(as, as->length + s + 1) == NULL)
                return (NULL);
        memmove(as->s + as->length, p, s);