summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libarchive/archive_read_support_format_tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_support_format_tar.c b/lib/libarchive/archive_read_support_format_tar.c
index f25916b..3dd4cda 100644
--- a/lib/libarchive/archive_read_support_format_tar.c
+++ b/lib/libarchive/archive_read_support_format_tar.c
@@ -2362,7 +2362,7 @@ url_decode(const char *in)
if (out == NULL)
return (NULL);
for (s = in, d = out; *s != '\0'; ) {
- if (*s == '%') {
+ if (s[0] == '%' && s[1] != '\0' && s[2] != '\0') {
/* Try to convert % escape */
int digit1 = tohex(s[1]);
int digit2 = tohex(s[2]);
OpenPOWER on IntegriCloud