From 6d05f3e01a26fa416c9d0150163db20abac4b4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 21 Mar 2018 22:11:05 +0100 Subject: New upstream version 0.8.5 --- test/FourSuite.cpp | 2 +- test/FourSuite.h | 2 +- test/VersionSuite.cpp | 2 +- test/VersionSuite.h | 2 +- test/test.cpp | 23 ++++++++++++++++++++++- 5 files changed, 26 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/FourSuite.cpp b/test/FourSuite.cpp index 706ee56..5ecdcb4 100644 --- a/test/FourSuite.cpp +++ b/test/FourSuite.cpp @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/test/FourSuite.h b/test/FourSuite.h index 24144cc..9a33c16 100644 --- a/test/FourSuite.h +++ b/test/FourSuite.h @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/test/VersionSuite.cpp b/test/VersionSuite.cpp index 82deddc..1c2d072 100644 --- a/test/VersionSuite.cpp +++ b/test/VersionSuite.cpp @@ -1,7 +1,7 @@ /* * uriparser - RFC 3986 URI parsing library * - * Copyright (C) 2014, Sebastian Pipping + * Copyright (C) 2014, Sebastian Pipping * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/test/VersionSuite.h b/test/VersionSuite.h index 495d3fc..f0276c5 100644 --- a/test/VersionSuite.h +++ b/test/VersionSuite.h @@ -1,7 +1,7 @@ /* * uriparser - RFC 3986 URI parsing library * - * Copyright (C) 2014, Sebastian Pipping + * Copyright (C) 2014, Sebastian Pipping * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/test/test.cpp b/test/test.cpp index d6f14cb..0b1290c 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -98,6 +98,7 @@ public: TEST_ADD(UriSuite::testCrash_FreeUriMembers_Bug20080116) TEST_ADD(UriSuite::testCrash_Report2418192) TEST_ADD(UriSuite::testPervertedQueryString); + TEST_ADD(UriSuite::testQueryStringEndingInEqualSign_NonBug32); TEST_ADD(UriSuite::testCrash_MakeOwner_Bug20080207) TEST_ADD(UriSuite::testQueryList) TEST_ADD(UriSuite::testQueryListPair) @@ -1576,6 +1577,26 @@ Rule | Example | hostSet | absPath | emptySeg helperTestQueryString("http://example.org/?&&=&&&=&&&&==&===&====", 5); } + void testQueryStringEndingInEqualSign_NonBug32() { + const char * queryString = "firstname=sdsd&lastname="; + + UriQueryListA * queryList = NULL; + int itemCount = 0; + const int res = uriDissectQueryMallocA(&queryList, &itemCount, + queryString, queryString + strlen(queryString)); + + TEST_ASSERT(res == URI_SUCCESS); + TEST_ASSERT(itemCount == 2); + TEST_ASSERT(queryList != NULL); + TEST_ASSERT(strcmp(queryList->key, "firstname") == 0); + TEST_ASSERT(strcmp(queryList->value, "sdsd") == 0); + TEST_ASSERT(strcmp(queryList->next->key, "lastname") == 0); + TEST_ASSERT(strcmp(queryList->next->value, "") == 0); + TEST_ASSERT(queryList->next->next == NULL); + + uriFreeQueryListA(queryList); + } + void helperTestQueryString(char const * uriString, int pairsExpected) { UriParserStateA state; UriUriA uri; -- cgit v1.2.3