More safec constraint avoidance
@@ -1040,7 +1040,7 @@ static ACVP_RESULT match_oes_page(ACVP_CTX *ctx,
for (k = 0; k < oe->dependencies.count; k++) {
int diff = 0;
const char *parsed_url = json_array_get_string(dependency_urls, k);
-
+ if (parsed_url) {
strcmp_s(oe->dependencies.deps[k]->url, ACVP_ATTR_URL_MAX,
parsed_url, &diff);
if (diff != 0) {
@@ -1048,6 +1048,7 @@ static ACVP_RESULT match_oes_page(ACVP_CTX *ctx,
break;
}
}
+ }
if (equal) {
/*
@@ -1280,11 +1281,13 @@ static int compare_emails(ACVP_STRING_LIST *email_list,
const char *tmp_email = NULL;
tmp_email = json_array_get_string(candidate_emails, i);
+ if (tmp_email) {
strcmp_s(email, ACVP_OE_STR_MAX, tmp_email, &diff);
if (diff != 0) {
*match = 0;
return ACVP_SUCCESS;
}
+ }
email_list = email_list->next;
i++;
@@ -1351,18 +1354,22 @@ static ACVP_RESULT compare_phone_numbers(ACVP_OE_PHONE_LIST *phone_list,
}
tmp_number = json_object_get_string(obj, "number");
+ if (tmp_number) {
strcmp_s(phone_list->number, ACVP_OE_STR_MAX, tmp_number, &diff);
if (diff != 0) {
*match = 0;
return ACVP_SUCCESS;
}
+ }
tmp_type = json_object_get_string(obj, "type");
+ if (tmp_type) {
strcmp_s(phone_list->type, ACVP_OE_STR_MAX, tmp_type, &diff);
if (diff != 0) {
*match = 0;
return ACVP_SUCCESS;
}
+ }
phone_list = phone_list->next;
i++;
