changeset 1128:a9e074b78cd5

check ecc key return, fix null pointer crash
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Jun 2015 21:48:13 +0800
parents b803ad2b9f4c
children d41c7b967868 36557295418e
files common-kex.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/common-kex.c	Fri Jun 12 22:57:48 2015 +0800
+++ b/common-kex.c	Tue Jun 23 21:48:13 2015 +0800
@@ -703,6 +703,9 @@
 	ecc_key *Q_C, *Q_S, *Q_them;
 
 	Q_them = buf_get_ecc_raw_pubkey(pub_them, algo_kex->ecc_curve);
+	if (Q_them == NULL) {
+		dropbear_exit("ECC error");
+	}
 
 	ses.dh_K = dropbear_ecc_shared_secret(Q_them, &param->key);