summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-25 23:59:31 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-26 00:01:08 +0100
commitfc34375984a4fd8f96999437b68d3a293338774b (patch)
tree330988073c7fbf3842fc08717a50b64aabecfcd9
parentaba01da6390894c9e7ebb6691da544bc01b6324d (diff)
downloadcurl-bagder/writeout-this-url.tar.gz
writeout: fix NULL dereference for "this url"bagder/writeout-this-url
Detected by torture test 1029 Follow-up to 7a90ddf88f5a
-rw-r--r--src/tool_writeout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tool_writeout.c b/src/tool_writeout.c
index 8b465db2d..9ce0a997e 100644
--- a/src/tool_writeout.c
+++ b/src/tool_writeout.c
@@ -141,7 +141,8 @@ void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo,
curl_easy_strerror(result), stream);
break;
case VAR_INPUT_URL:
- fputs(per->this_url, stream);
+ if(per->this_url)
+ fputs(per->this_url, stream);
break;
case VAR_URLNUM:
fprintf(stream, "%u", per->urlnum);