aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-04-18 10:33:55 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-04-18 10:33:55 +0200
commitc705fb6e3bef59d6c4c36991030cb07ec22d07dc (patch)
treee004942e481f53cc4c3e1c144731fff9ddbbd5b6
parent1a36aa21ba7ec4fb93120e1854c73d410810897c (diff)
downloadlibssh-c705fb6e3bef59d6c4c36991030cb07ec22d07dc.tar.gz
libssh-c705fb6e3bef59d6c4c36991030cb07ec22d07dc.tar.xz
libssh-c705fb6e3bef59d6c4c36991030cb07ec22d07dc.zip
kex1: Add missing NULL check in make_rsa1_string()
CID 1388445 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/kex1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kex1.c b/src/kex1.c
index 328ed7f1..397b3d2f 100644
--- a/src/kex1.c
+++ b/src/kex1.c
@@ -51,6 +51,10 @@ static ssh_string make_rsa1_string(ssh_string e, ssh_string n){
ssh_string ret = NULL;
buffer = ssh_buffer_new();
+ if (buffer == NULL) {
+ goto error;
+ }
+
rsa = ssh_string_from_char("ssh-rsa1");
if (rsa == NULL) {
goto error;