From ab929012529420f1a29c9e17990ad23500aa16a9 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 16 Oct 2019 15:29:50 -0700 Subject: [PATCH] owe: check for error return getting shared_secret --- src/owe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/owe.c b/src/owe.c index daaf1f30..9af3a0de 100644 --- a/src/owe.c +++ b/src/owe.c @@ -165,9 +165,11 @@ static bool owe_compute_keys(struct owe_sm *owe, const void *public_key, l_ecc_point_free(other_public); nbytes = l_ecc_scalar_get_data(shared_secret, ss_buf, sizeof(ss_buf)); - l_ecc_scalar_free(shared_secret); + if (nbytes < 0) + return false; + ptr += l_ecc_point_get_x(owe->public_key, ptr, sizeof(key)); memcpy(ptr, public_key, nbytes); ptr += nbytes;