[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 25/282: curl: make #0 not output the full URL
From: |
gnunet |
Subject: |
[gnurl] 25/282: curl: make #0 not output the full URL |
Date: |
Wed, 01 Apr 2020 14:28:10 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 4431ed2484f0e66096642ee76a2bbeedec5bde79
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Jan 13 12:30:37 2020 +0100
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
---
src/tool_urlglob.c | 4 +--
tests/data/Makefile.inc | 2 +-
tests/data/test1176 | 68 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 3 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, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <address@hidden>, 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 */
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index 978f8aa5b..51cc92062 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -133,7 +133,7 @@ test1144 test1145 test1146 test1147 test1148 test1149
test1150 test1151 \
test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \
test1160 test1161 test1162 test1163 test1164 test1165 test1166 test1167 \
\
-test1170 test1171 test1172 test1173 test1174 test1175 \
+test1170 test1171 test1172 test1173 test1174 test1175 test1176 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
diff --git a/tests/data/test1176 b/tests/data/test1176
new file mode 100644
index 000000000..491bee16f
--- /dev/null
+++ b/tests/data/test1176
@@ -0,0 +1,68 @@
+<testcase>
+<info>
+<keywords>
+globbing
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP GET
+ </name>
+ <command option="no-output">
+http://%HOSTIP:%HTTPPORT/1176 -o 'log/base-#0'
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1176 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+<file name="log/base-#0">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</file>
+</verify>
+</testcase>
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 16/282: cmake: Enable SMB for Windows builds, (continued)
- [gnurl] 16/282: cmake: Enable SMB for Windows builds, gnunet, 2020/04/01
- [gnurl] 14/282: fix: Copyright year out of date, should be 2020, gnunet, 2020/04/01
- [gnurl] 18/282: ngtcp2: Add an error code for QUIC connection errors, gnunet, 2020/04/01
- [gnurl] 09/282: include: remove non-curl prefixed defines, gnunet, 2020/04/01
- [gnurl] 21/282: libssh2: add support for forcing a hostkey type, gnunet, 2020/04/01
- [gnurl] 22/282: misc: Copyright year out of date, should be 2020, gnunet, 2020/04/01
- [gnurl] 19/282: schannel: Make CURLOPT_CAINFO work better on Windows 7, gnunet, 2020/04/01
- [gnurl] 23/282: curl: remove 'config' field from OutStruct, gnunet, 2020/04/01
- [gnurl] 13/282: hostip: move code to resolve IP address literals to `Curl_resolv`, gnunet, 2020/04/01
- [gnurl] 11/282: test1167: verify global symbols in public headers are curl prefixed, gnunet, 2020/04/01
- [gnurl] 25/282: curl: make #0 not output the full URL,
gnunet <=
- [gnurl] 26/282: ConnectionExists: respect the max_concurrent_streams limits, gnunet, 2020/04/01
- [gnurl] 30/282: schannel_verify: Fix alt names manual verify for UNICODE builds, gnunet, 2020/04/01
- [gnurl] 31/282: CMake: use check_symbol_exists also for inet_pton, gnunet, 2020/04/01
- [gnurl] 39/282: ROADMAP: thread-safe `curl_global_init()`, gnunet, 2020/04/01
- [gnurl] 27/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 33/282: wolfssh: set the password correctly for PASSWORD auth, gnunet, 2020/04/01
- [gnurl] 42/282: CMake: support specifying the target Windows version, gnunet, 2020/04/01
- [gnurl] 35/282: libssh2: fix variable type, gnunet, 2020/04/01
- [gnurl] 24/282: wolfSSH: new SSH backend, gnunet, 2020/04/01
- [gnurl] 45/282: http: move "oauth_bearer" from connectdata to Curl_easy, gnunet, 2020/04/01