diff options
Diffstat (limited to 'src/libs/3rdparty/libarchive/archive_pathmatch.c')
-rw-r--r-- | src/libs/3rdparty/libarchive/archive_pathmatch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libs/3rdparty/libarchive/archive_pathmatch.c b/src/libs/3rdparty/libarchive/archive_pathmatch.c index 619e2b622..0867a268e 100644 --- a/src/libs/3rdparty/libarchive/archive_pathmatch.c +++ b/src/libs/3rdparty/libarchive/archive_pathmatch.c @@ -384,6 +384,8 @@ __archive_pathmatch(const char *p, const char *s, int flags) /* Empty pattern only matches the empty string. */ if (p == NULL || *p == '\0') return (s == NULL || *s == '\0'); + else if (s == NULL) + return (0); /* Leading '^' anchors the start of the pattern. */ if (*p == '^') { @@ -424,6 +426,8 @@ __archive_pathmatch_w(const wchar_t *p, const wchar_t *s, int flags) /* Empty pattern only matches the empty string. */ if (p == NULL || *p == L'\0') return (s == NULL || *s == L'\0'); + else if (s == NULL) + return (0); /* Leading '^' anchors the start of the pattern. */ if (*p == L'^') { |