summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-05-27 23:24:27 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-05-28 23:57:31 +0200
commit6482773d30c96fe886c294036acbc8ad2130bc31 (patch)
tree0d602b3dc3aa6ae6b9cdd438c5a100fbdfedeb39 /lib
parent8541d02c967c993f6e36fd78c59c50b70315ac91 (diff)
downloadcurl-6482773d30c96fe886c294036acbc8ad2130bc31.tar.gz
fnmatch: insist on escaped bracket to match
A non-escaped bracket ([) is for a character group - as documented. It will *not* match an individual bracket anymore. Test case 1307 updated accordingly to match. Problem detected by OSS-Fuzz, although this fix is probably not a final fix for the notorious timeout issues. Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8525 Closes #2614
Diffstat (limited to 'lib')
-rw-r--r--lib/curl_fnmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c
index 268fe79b3..bd4e61f4e 100644
--- a/lib/curl_fnmatch.c
+++ b/lib/curl_fnmatch.c
@@ -334,9 +334,9 @@ static int loop(const unsigned char *pattern, const unsigned char *string,
s++;
break;
}
+ /* Syntax error in set; mismatch! */
+ return CURL_FNMATCH_NOMATCH;
- /* Syntax error in set: this must be taken as a regular character. */
- /* FALLTHROUGH */
default:
if(*p++ != *s++)
return CURL_FNMATCH_NOMATCH;