aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-26 11:07:30 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-19 22:01:28 +0200
commit0f2b7bb870091123fe89ba77b005d50684506896 (patch)
treea4793e1c672a99eae24b3898d88a6824f1c0a805
parent504afadbf064de41c5d7b60c1d68959dc3352ac6 (diff)
downloadlibssh-0f2b7bb870091123fe89ba77b005d50684506896.tar.gz
libssh-0f2b7bb870091123fe89ba77b005d50684506896.tar.xz
libssh-0f2b7bb870091123fe89ba77b005d50684506896.zip
packet: Add missing null pointer check in ssh_packet_socket_callback()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/packet.c3
1 files changed, 3 insertions, 0 deletions
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