hx509: Fix coverity warnings

This commit is contained in:
Nicolas Williams
2022-01-17 17:36:48 -06:00
parent 2e729a9aa2
commit dd71303a2f
7 changed files with 39 additions and 19 deletions

View File

@@ -2785,9 +2785,12 @@ acert1_kus(struct acert_options *opt,
size_t unwanted = 0;
size_t wanted = opt->has_ku_strings.num_strings;
size_t i, k, sz;
int ret;
memset(&ku, 0, sizeof(ku));
decode_KeyUsage(e->extnValue.data, e->extnValue.length, &ku, &sz);
ret = decode_KeyUsage(e->extnValue.data, e->extnValue.length, &ku, &sz);
if (ret)
return ret;
ku_num = KeyUsage2int(ku);
/* Validate requested key usage values */