1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-03 10:51:49 -05:00

writeout: fix NULL dereference for "this url"

Detected by torture test 1029

Follow-up to 7a90ddf88f5a

Closes #6374
This commit is contained in:
Daniel Stenberg 2020-12-25 23:59:31 +01:00
parent aba01da639
commit 44a504e5e4
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -141,7 +141,8 @@ void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo,
curl_easy_strerror(result), stream); curl_easy_strerror(result), stream);
break; break;
case VAR_INPUT_URL: case VAR_INPUT_URL:
fputs(per->this_url, stream); if(per->this_url)
fputs(per->this_url, stream);
break; break;
case VAR_URLNUM: case VAR_URLNUM:
fprintf(stream, "%u", per->urlnum); fprintf(stream, "%u", per->urlnum);