diff --git a/src/kex.c b/src/kex.c index 60df9573c7..ee51027741 100644 --- a/src/kex.c +++ b/src/kex.c @@ -1070,7 +1070,7 @@ static int diffie_hellman_sha256(LIBSSH2_SESSION *session, _libssh2_bn_from_bin(exchange_state->f, exchange_state->f_value_len, exchange_state->f_value); - + if(_libssh2_get_string(&buf, &(exchange_state->h_sig), &(exchange_state->h_sig_len))) { ret = _libssh2_error(session, LIBSSH2_ERROR_HOSTKEY_INIT, diff --git a/src/misc.c b/src/misc.c index d96470dbe2..bd084c854f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -799,7 +799,8 @@ int _libssh2_copy_string(LIBSSH2_SESSION *session, struct string_buf *buf, *outbuf = LIBSSH2_ALLOC(session, str_len); if(*outbuf) { memcpy(*outbuf, str, str_len); - } else { + } + else { return -1; }