mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
All error path consistent with ssh_packet_kexinit
This commit is contained in:
10
src/kex.c
10
src/kex.c
@ -290,11 +290,13 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (buffer_add_ssh_string(session->in_hashbuf, str) < 0) {
|
if (buffer_add_ssh_string(session->in_hashbuf, str) < 0) {
|
||||||
|
ssh_set_error(session, SSH_FATAL, "Error adding string in hash buffer");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
strings[i] = ssh_string_to_char(str);
|
strings[i] = ssh_string_to_char(str);
|
||||||
if (strings[i] == NULL) {
|
if (strings[i] == NULL) {
|
||||||
|
ssh_set_error_oom(session);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
ssh_string_free(str);
|
ssh_string_free(str);
|
||||||
@ -305,8 +307,8 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
|
|||||||
if (server_kex) {
|
if (server_kex) {
|
||||||
session->client_kex.methods = malloc(10 * sizeof(char **));
|
session->client_kex.methods = malloc(10 * sizeof(char **));
|
||||||
if (session->client_kex.methods == NULL) {
|
if (session->client_kex.methods == NULL) {
|
||||||
leave_function();
|
ssh_set_error_oom(session);
|
||||||
return -1;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
@ -315,8 +317,8 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
|
|||||||
} else { /* client */
|
} else { /* client */
|
||||||
session->server_kex.methods = malloc(10 * sizeof(char **));
|
session->server_kex.methods = malloc(10 * sizeof(char **));
|
||||||
if (session->server_kex.methods == NULL) {
|
if (session->server_kex.methods == NULL) {
|
||||||
leave_function();
|
ssh_set_error_oom(session);
|
||||||
return -1;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
|
Reference in New Issue
Block a user