aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-26 11:07:30 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-24 09:48:35 +0200
commita190ff93026a43fdf0b466aa98d3417291569c52 (patch)
tree5f5a56290f48ed643ecb8edc13393a2f7d95349e /src
parent2e7e0ad6c9f858c24ff80fa26e79b6309c0385ff (diff)
downloadlibssh-a190ff93026a43fdf0b466aa98d3417291569c52.tar.gz
libssh-a190ff93026a43fdf0b466aa98d3417291569c52.tar.xz
libssh-a190ff93026a43fdf0b466aa98d3417291569c52.zip
packet: Add missing null pointer check in ssh_packet_socket_callback()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-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