From b698f6361ce294d275463d10df5f6613e84df380 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 19 Jun 2013 12:06:43 +0200 Subject: [PATCH] kex1: Fix a possible null pointer dereference. --- src/kex1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kex1.c b/src/kex1.c index 0e3cbda6..b396a719 100644 --- a/src/kex1.c +++ b/src/kex1.c @@ -47,6 +47,9 @@ static ssh_string make_rsa1_string(ssh_string e, ssh_string n){ buffer = ssh_buffer_new(); rsa = ssh_string_from_char("ssh-rsa1"); + if (rsa == NULL) { + goto error; + } if (buffer_add_ssh_string(buffer, rsa) < 0) { goto error;