summaryrefslogtreecommitdiff
path: root/lib/escape.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/escape.c')
-rw-r--r--lib/escape.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/escape.c b/lib/escape.c
index f3c558ed0..26d44df7b 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -89,6 +89,9 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH);
length = (inlength?(size_t)inlength:strlen(string));
+ if(!length)
+ return strdup("");
+
while(length--) {
unsigned char in = *string; /* we need to treat the characters unsigned */