summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2020-06-03 10:11:21 +0200
committerAndreas Schneider <asn@cryptomilk.org>2020-06-03 10:40:06 +0200
commit245ad744b5ab0582fef7cf3905a717b791d7e08b (patch)
treec5b456def018706496a3781c3c2e8d18f6fc088a
parent10b3ebbe61a7031a3dae97f05834442220447181 (diff)
downloadlibssh-245ad744b5ab0582fef7cf3905a717b791d7e08b.tar.gz
libssh-245ad744b5ab0582fef7cf3905a717b791d7e08b.tar.xz
libssh-245ad744b5ab0582fef7cf3905a717b791d7e08b.zip
buffer: Add NULL check for 'buffer' argument
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
-rw-r--r--src/buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 476bc135..ce12f491 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -299,6 +299,10 @@ int ssh_buffer_reinit(struct ssh_buffer_struct *buffer)
*/
int ssh_buffer_add_data(struct ssh_buffer_struct *buffer, const void *data, uint32_t len)
{
+ if (buffer == NULL) {
+ return -1;
+ }
+
buffer_verify(buffer);
if (data == NULL) {