From a190ff93026a43fdf0b466aa98d3417291569c52 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 26 Sep 2018 11:07:30 +0200 Subject: [PATCH] packet: Add missing null pointer check in ssh_packet_socket_callback() Signed-off-by: Andreas Schneider --- src/packet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/packet.c b/src/packet.c index 3ce72def..36c037eb 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1062,6 +1062,9 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user) packet_len - (lenfield_blocksize - sizeof(uint32_t)); cleartext_packet = ssh_buffer_allocate(session->in_buffer, packet_remaining); + if (cleartext_packet == NULL) { + goto error; + } if (session->current_crypto) { /* * Decrypt the rest of the packet (lenfield_blocksize bytes already