summaryrefslogtreecommitdiff
path: root/common-kex.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-06-23 21:48:13 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-06-23 21:48:13 +0800
commit5174f6d8bc39e2d7025e16122b27c048eb55c675 (patch)
tree8e03bc1ae370758140e181e3febb208861502703 /common-kex.c
parent2036b0500e240edb082cd98bf7d78de2df779e27 (diff)
downloaddropbear-5174f6d8bc39e2d7025e16122b27c048eb55c675.tar.gz
check ecc key return, fix null pointer crash
Diffstat (limited to 'common-kex.c')
-rw-r--r--common-kex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common-kex.c b/common-kex.c
index 2907715..e2b4f8e 100644
--- a/common-kex.c
+++ b/common-kex.c
@@ -703,6 +703,9 @@ void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
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);