@@ -1134,7 +1134,7 @@ check_host_key(char *hostname, const struct ssh_conn_info *cinfo,
11341134 options .fingerprint_hash , SSH_FP_RANDOMART );
11351135 if (fp == NULL || ra == NULL )
11361136 fatal_f ("sshkey_fingerprint failed" );
1137- logit ("Host key fingerprint is %s\n%s" , fp , ra );
1137+ logit ("Host key fingerprint is %s\n%s" , fp , ra ); // CodeQL [SM02311]: false positive NULL check for ra in earlier line
11381138 free (ra );
11391139 free (fp );
11401140 }
@@ -1188,7 +1188,7 @@ check_host_key(char *hostname, const struct ssh_conn_info *cinfo,
11881188 xextendf (& msg1 , "\n" , "%s key fingerprint is %s." ,
11891189 type , fp );
11901190 if (options .visual_host_key )
1191- xextendf (& msg1 , "\n" , "%s" , ra );
1191+ xextendf (& msg1 , "\n" , "%s" , ra ); // CodeQL [SM02311]: false positive NULL check for ra in earlier line
11921192 if (options .verify_host_key_dns ) {
11931193 xextendf (& msg1 , "\n" ,
11941194 "%s host key fingerprint found in DNS." ,
@@ -1640,7 +1640,7 @@ show_other_keys(struct hostkeys *hostkeys, struct sshkey *key)
16401640 found -> host , found -> file , found -> line ,
16411641 sshkey_type (found -> key ), fp );
16421642 if (options .visual_host_key )
1643- logit ("%s" , ra );
1643+ logit ("%s" , ra ); // CodeQL [SM02311]: false positive NULL check for ra in earlier line
16441644 free (ra );
16451645 free (fp );
16461646 ret = 1 ;
0 commit comments