← Commit list

c2676bf9e6

Viktor Szakats
Viktor Szakats
2026-08-24
SUCCESS Duration: 400s

Subject

vssh: silence gcc-11 `-Wnull-dereference`, dedupe `CURL_EASY_STR()` calls

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vssh/vssh.c+5 -5
@@ -366,6 +366,8 @@ CURLcode Curl_ssh_setup_pkey(struct Curl_easy *data, struct ssh_conn *sshc)
{
char *home = NULL;
if(data->set.ssh_auth_types & CURLSSH_AUTH_PUBLICKEY) {
+ const char *str;
+
sshc->pub_key = sshc->priv_key = NULL;
if(CURL_EASY_STR(data, STRING_SSH_PRIVATE_KEY)) {
@@ -418,11 +420,9 @@ CURLcode Curl_ssh_setup_pkey(struct Curl_easy *data, struct ssh_conn *sshc)
* library extract the public key from the private key file. This is done
* by passing sshc->pub_key = NULL.
*/
- if(CURL_EASY_STR(data, STRING_SSH_PUBLIC_KEY) &&
- /* treat empty string the same way as NULL */
- CURL_EASY_STR(data, STRING_SSH_PUBLIC_KEY)[0]) {
- sshc->pub_key = curlx_strdup(
- CURL_EASY_STR(data, STRING_SSH_PUBLIC_KEY));
+ str = CURL_EASY_STR(data, STRING_SSH_PUBLIC_KEY);
+ if(str && *str) { /* treat empty string the same way as NULL */
+ sshc->pub_key = curlx_strdup(str);
if(!sshc->pub_key)
goto fail;
}