fix two similar dereference without check issue
@@ -296,6 +296,10 @@ static ACVP_RESULT acvp_kas_ecc_cdh(ACVP_CTX *ctx, ACVP_CAPS_LIST *cap, ACVP_TES
curve = json_object_get_string(groupobj, "curve");
test_type = json_object_get_string(groupobj, "testType");
+ if (!test_type) {
+ ACVP_LOG_ERR("Unable to parse testType from JSON");
+ return ACVP_MALFORMED_JSON;
+ }
if (!strncmp(test_type, "AFT", 3))
stc->test_type = ACVP_KAS_ECC_TT_AFT;
if (!strncmp(test_type, "VAL", 3))
@@ -395,6 +399,10 @@ static ACVP_RESULT acvp_kas_ecc_comp(ACVP_CTX *ctx, ACVP_CAPS_LIST *cap, ACVP_TE
curve = json_object_get_string(groupobj, "curve");
hash = json_object_get_string(groupobj, "hashAlg");
test_type = json_object_get_string(groupobj, "testType");
+ if (!test_type) {
+ ACVP_LOG_ERR("Unable to parse testType from JSON");
+ return ACVP_MALFORMED_JSON;
+ }
if (!strncmp(test_type, "AFT", 3))
stc->test_type = ACVP_KAS_ECC_TT_AFT;
if (!strncmp(test_type, "VAL", 3))
