1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-20 02:42:09 +03:00

We should check whether *key_method is a NULL pointer instead of key_method

Signed-off-by: renmingshuai <renmingshuai@huawei.com>
This commit is contained in:
renmingshuai
2023-07-01 10:14:48 +08:00
committed by Viktor Szakats
parent 724effcb47
commit bec57c409d

View File

@@ -1410,7 +1410,7 @@ _libssh2_key_sign_algorithm(LIBSSH2_SESSION *session,
LIBSSH2_FREE(session, *key_method); LIBSSH2_FREE(session, *key_method);
*key_method = LIBSSH2_ALLOC(session, match_len); *key_method = LIBSSH2_ALLOC(session, match_len);
if(key_method) { if(*key_method) {
memcpy(*key_method, match, match_len); memcpy(*key_method, match, match_len);
*key_method_len = match_len; *key_method_len = match_len;
} }