]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh: add NULL check for Curl_meta_get()
authorDaniel Stenberg <daniel@haxx.se>
Thu, 15 May 2025 19:58:36 +0000 (21:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 15 May 2025 21:04:37 +0000 (23:04 +0200)
It really cannot return NULL in a working condition, but ...

Pointed out by Coverity.

Closes #17359

lib/vssh/libssh.c

index 30fde410dd49acc76d1a5f82464072c965ecfd3e..14568e67ddd38c33c5821f12b5e7f5ecaf2ab09c 100644 (file)
@@ -2458,7 +2458,7 @@ static CURLcode myssh_done(struct Curl_easy *data,
   CURLcode result = CURLE_OK;
   struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY);
 
-  if(!status) {
+  if(!status && sshp) {
     /* run the state-machine */
     result = myssh_block_statemach(data, sshc, sshp, FALSE);
   }