diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-06-23 21:48:13 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-06-23 21:48:13 +0800 |
commit | 839e023ed88e7c8c42b8ea8bb9e11ffd46668d9c (patch) | |
tree | 278baa684d1fb7a2767590f282673795a846bdc8 | |
parent | 2e05a2b8c417a91b23e87b2291c4b10859b9d89e (diff) |
check ecc key return, fix null pointer crash
-rw-r--r-- | common-kex.c | 3 |
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, ¶m->key); |