mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
Fix doublefree happening after a negociation error
This commit is contained in:
@@ -296,6 +296,7 @@ static int dh_handshake(ssh_session session) {
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
session->dh_server_signature = signature;
|
session->dh_server_signature = signature;
|
||||||
|
signature=NULL; /* ownership changed */
|
||||||
if (dh_build_k(session) < 0) {
|
if (dh_build_k(session) < 0) {
|
||||||
ssh_set_error(session, SSH_FATAL, "Cannot build k number");
|
ssh_set_error(session, SSH_FATAL, "Cannot build k number");
|
||||||
rc = SSH_ERROR;
|
rc = SSH_ERROR;
|
||||||
@@ -400,10 +401,6 @@ error:
|
|||||||
string_burn(f);
|
string_burn(f);
|
||||||
string_free(f);
|
string_free(f);
|
||||||
}
|
}
|
||||||
if(pubkey != NULL){
|
|
||||||
string_burn(pubkey);
|
|
||||||
string_free(pubkey);
|
|
||||||
}
|
|
||||||
if(signature != NULL){
|
if(signature != NULL){
|
||||||
string_burn(signature);
|
string_burn(signature);
|
||||||
string_free(signature);
|
string_free(signature);
|
||||||
|
|||||||
Reference in New Issue
Block a user