lib: stop NULL-checking conn->passwd and ->user

They always point to a string. The string might be zero length.

Closes #19059
This commit is contained in:
Daniel Stenberg 2025-10-14 14:43:46 +02:00
parent 5e46318414
commit 62961d6cc5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 4 additions and 10 deletions

View file

@ -3335,14 +3335,9 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done)
function to make the reuse checks properly be able to check this bit. */
connkeep(conn, "SSH default");
if(conn->user)
infof(data, "User: '%s'", conn->user);
else
infof(data, "User: NULL");
infof(data, "User: '%s'", conn->user);
#ifdef CURL_LIBSSH2_DEBUG
if(conn->passwd) {
infof(data, "Password: %s", conn->passwd);
}
infof(data, "Password: %s", conn->passwd);
sock = conn->sock[FIRSTSOCKET];
#endif /* CURL_LIBSSH2_DEBUG */