1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

packet: Add missing null pointer check in ssh_packet_socket_callback()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-09-26 11:07:30 +02:00
parent 2e7e0ad6c9
commit a190ff9302

View File

@@ -1062,6 +1062,9 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
packet_len - (lenfield_blocksize - sizeof(uint32_t)); packet_len - (lenfield_blocksize - sizeof(uint32_t));
cleartext_packet = ssh_buffer_allocate(session->in_buffer, cleartext_packet = ssh_buffer_allocate(session->in_buffer,
packet_remaining); packet_remaining);
if (cleartext_packet == NULL) {
goto error;
}
if (session->current_crypto) { if (session->current_crypto) {
/* /*
* Decrypt the rest of the packet (lenfield_blocksize bytes already * Decrypt the rest of the packet (lenfield_blocksize bytes already