From 9e15e5d26255f7a415af414eeae6181d561c382a Mon Sep 17 00:00:00 2001 From: Cameron MacMinn Date: Fri, 5 May 2017 17:36:17 -0600 Subject: [PATCH] Fix NULL pointer dereference --- example/util/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/util/utils.c b/example/util/utils.c index 688aa75..2b0da43 100644 --- a/example/util/utils.c +++ b/example/util/utils.c @@ -179,6 +179,9 @@ char *generate_private_EC_key (int curve_nid, pem_password_cb *cb) } group = EC_GROUP_new_by_curve_name(curve_nid); + if (!group) { + return NULL; + } EC_GROUP_set_asn1_flag(group, asn1_flag); EC_GROUP_set_point_conversion_form(group, form); EC_KEY_set_group(eckey, group);