Avoid crash on cleanup

This commit is contained in:
Jakub Jelen 2020-06-01 12:20:31 +02:00
parent 5cd9552fc4
commit 7f87bd9cc9

View File

@ -1738,7 +1738,7 @@ diff -up openssh/packet.c.audit openssh/packet.c
state->newkeys[mode] = NULL;
}
/* note that both bytes and the seqnr are not reset */
@@ -2167,6 +2183,71 @@ ssh_packet_get_output(struct ssh *ssh)
@@ -2167,6 +2183,72 @@ ssh_packet_get_output(struct ssh *ssh)
return (void *)ssh->state->output;
}
@ -1769,6 +1769,7 @@ diff -up openssh/packet.c.audit openssh/packet.c
+
+ cipher_free(state->receive_context);
+ cipher_free(state->send_context);
+ state->send_context = state->receive_context = NULL;
+
+ sshbuf_free(state->input);
+ state->input = NULL;