[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 30/73: curl: don't pass semicolons when parsing Con
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 30/73: curl: don't pass semicolons when parsing Content-Disposition |
Date: |
Tue, 24 Oct 2017 18:54:11 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit c95c92da7584483368c8761c8cca276b5401530c
Author: Kristiyan Tsaklev <address@hidden>
AuthorDate: Sat Oct 7 17:47:11 2017 +0300
curl: don't pass semicolons when parsing Content-Disposition
Test 1422 updated to verify.
Closes #1964
---
src/tool_cb_hdr.c | 15 ++++++---------
tests/data/test1422 | 2 +-
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
index bb982d2e4..7f2181f40 100644
--- a/src/tool_cb_hdr.c
+++ b/src/tool_cb_hdr.c
@@ -161,8 +161,13 @@ static char *parse_filename(const char *ptr, size_t len)
else
stop = ';';
+ /* scan for the end letter and stop there */
+ q = strchr(p, stop);
+ if(q)
+ *q = '\0';
+
/* if the filename contains a path, only use filename portion */
- q = strrchr(copy, '/');
+ q = strrchr(p, '/');
if(q) {
p = q + 1;
if(!*p) {
@@ -183,14 +188,6 @@ static char *parse_filename(const char *ptr, size_t len)
}
}
- /* scan for the end letter and stop there */
- for(q = p; *q; ++q) {
- if(*q == stop) {
- *q = '\0';
- break;
- }
- }
-
/* make sure the file name doesn't end in \r or \n */
q = strchr(p, '\r');
if(q)
diff --git a/tests/data/test1422 b/tests/data/test1422
index 9b436cc4e..df9d750dd 100644
--- a/tests/data/test1422
+++ b/tests/data/test1422
@@ -16,7 +16,7 @@ Server: test-server/fake
Content-Length: 0
Connection: close
Content-Type: text/html
-Content-Disposition: filename=name1422; charset=funny; option=strange
+Content-Disposition: filename=name1422; charset=funny; option=str//nge
</data>
</reply>
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 20/73: mime: be tolerant about setting twice the same header list in a part., (continued)
- [GNUnet-SVN] [gnurl] 20/73: mime: be tolerant about setting twice the same header list in a part., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 12/73: multi_cleanup: call DONE on handles that never got that, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 01/73: RELEASE-PROCEDURE: update the release schedule, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 14/73: tests: added flaky keyword to tests 587 and 644, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 33/73: CURLOPT_NOPROGRESS.3: also refer to xferinfofunction, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 24/73: mime: avoid resetting a part's encoder when part's contents change., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 48/73: mime: fix the content reader to handle >16K data properly, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 43/73: HELP-US: the label "PR-welcome" is now renamed to "help wanted", gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 22/73: RELEASE-NOTES: synced with a4c1c75da30af1, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 39/73: test950; verify SMTP with custom request, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 30/73: curl: don't pass semicolons when parsing Content-Disposition,
gnunet <=
- [GNUnet-SVN] [gnurl] 42/73: RELEASE-NOTES: synced with 5505df7d2, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 44/73: winbuild/BUILD.WINDOWS.txt: mention WITH_NGHTTP2, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 15/73: pingpong: return error when trying to send without connection, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 45/73: cli tool: reimplement stdin buffering in -F option., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 67/73: ftp: reject illegal IP/port in PASV 227 response, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 54/73: ldap: silence clang warning, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 51/73: configure: remove the C++ compiler check, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 47/73: mime: keep "text/plain" content type if user-specified., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 56/73: setopt: avoid integer overflows when setting millsecond values, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 52/73: memdebug: trace send, recv and socket, gnunet, 2017/10/24