diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-01-13 12:30:37 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-01-13 15:37:46 +0100 |
commit | 4431ed2484f0e66096642ee76a2bbeedec5bde79 (patch) | |
tree | 4faa3df1127dd28ee0962b44664ce82d170eb0c1 /src | |
parent | 6773c7ca65cf2183295e56603f9b86a5ce816a06 (diff) |
curl: make #0 not output the full URL
It was not intended nor documented!
Added test 1176 to verify.
Reported-by: vshmuk on hackerone
Closes #4812
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_urlglob.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index 450cdcf32..6c8716104 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -627,7 +627,7 @@ CURLcode glob_match_url(char **result, char *filename, URLGlob *glob) unsigned long num = strtoul(&filename[1], &filename, 10); URLPattern *pat = NULL; - if(num < glob->size) { + if(num && (num < glob->size)) { unsigned long i; num--; /* make it zero based */ /* find the correct glob entry */ |