1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-25 01:28:51 -05:00

smtp: set auth correctly

Regression since 7.69.0 and 68fb25fa3f.

The code wrongly assigned 'from' instead of 'auth' which probably was a
copy and paste mistake from other code, leading to that auth could
remain NULL and later cause an error to be returned.

Assisted-by: Eric Sauvageau
Fixes #5294
Closes #5295
This commit is contained in:
Daniel Stenberg 2020-04-25 00:22:21 +02:00
parent 6ad062ae71
commit 446fb0518b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -625,8 +625,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
utf8 = TRUE; utf8 = TRUE;
if(host.name) { if(host.name) {
free(from); auth = aprintf("<%s@%s>", address, host.name);
from = aprintf("<%s@%s>", address, host.name);
Curl_free_idnconverted_hostname(&host); Curl_free_idnconverted_hostname(&host);
} }
@ -636,8 +635,6 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
auth = aprintf("<%s>", address); auth = aprintf("<%s>", address);
free(address); free(address);
if(!from)
return CURLE_OUT_OF_MEMORY;
} }
else else
/* Empty AUTH, RFC-2554, sect. 5 */ /* Empty AUTH, RFC-2554, sect. 5 */