summaryrefslogtreecommitdiff
path: root/tests/libtest/lib543.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-06-24 15:24:35 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-06-25 00:00:35 +0200
commit79d8099ff0f826e213846af78436048d06cd48db (patch)
treef739135f7aa6a96cb6477850ff85cf30f82d4bc4 /tests/libtest/lib543.c
parent32defc31970ddd0e5da14481b88f06428630bdb4 (diff)
downloadcurl-79d8099ff0f826e213846af78436048d06cd48db.tar.gz
test543: extended to verify zero length input
As was reported in #5601
Diffstat (limited to 'tests/libtest/lib543.c')
-rw-r--r--tests/libtest/lib543.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c
index 5fe5cd1ce..c494d3d83 100644
--- a/tests/libtest/lib543.c
+++ b/tests/libtest/lib543.c
@@ -49,11 +49,21 @@ int test(char *URL)
s = curl_easy_escape(easy, (const char *)a, asize);
- if(s)
+ if(s) {
printf("%s\n", s);
+ curl_free(s);
+ }
- if(s)
+ s = curl_easy_escape(easy, "", 0);
+ if(s) {
+ printf("IN: '' OUT: '%s'\n", s);
curl_free(s);
+ }
+ s = curl_easy_escape(easy, " 123", 3);
+ if(s) {
+ printf("IN: ' 12' OUT: '%s'\n", s);
+ curl_free(s);
+ }
curl_easy_cleanup(easy);
curl_global_cleanup();