gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 206/219: lib1560: add tests for parsing URL with to


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 206/219: lib1560: add tests for parsing URL with too long scheme
Date: Wed, 22 May 2019 19:19:05 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 8b038bcc95c31ef90b1715b21f76ded390de88f2
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon May 20 10:00:27 2019 +0200

    lib1560: add tests for parsing URL with too long scheme
    
    Ref: #3905
---
 tests/libtest/lib1560.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c
index a18d56a8e..1b72599ec 100644
--- a/tests/libtest/lib1560.c
+++ b/tests/libtest/lib1560.c
@@ -282,6 +282,14 @@ static struct testcase get_parts_list[] ={
 };
 
 static struct urltestcase get_url_list[] = {
+  /* 40 bytes scheme is the max allowed */
+  {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA://hostname/path",
+   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa://hostname/path",
+   CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
+  /* 41 bytes scheme is not allowed */
+  {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA://hostname/path",
+   "",
+   CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_MALFORMED_INPUT},
   {"https://[fe80::20c:29ff:fe9c:409b%]:1234";,
    "",
    0, 0, CURLUE_MALFORMED_INPUT},
@@ -417,6 +425,16 @@ static int checkurl(const char *url, const char *out)
 
 /* !checksrc! disable SPACEBEFORECOMMA 1 */
 static struct setcase set_parts_list[] = {
+  {"https://example.com/";,
+   /* Set a 41 bytes scheme. That's too long so the old scheme remains set. */
+   "scheme=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc,",
+   "https://example.com/";,
+   0, CURLU_NON_SUPPORT_SCHEME, CURLUE_OK, CURLUE_MALFORMED_INPUT},
+  {"https://example.com/";,
+   /* set a 40 bytes scheme */
+   "scheme=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,",
+   "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb://example.com/",
+   0, CURLU_NON_SUPPORT_SCHEME, CURLUE_OK, CURLUE_OK},
   {"https://[::1%25fake]:1234/";,
    "zoneid=NULL,",
    "https://[::1]:1234/";,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]