Fix potential overflow due to bad initialization. Might fix #72.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-12-11 21:58:48 +01:00
parent bbf474811b
commit dba805dc04

View File

@@ -286,7 +286,7 @@ int cbor_make_credential(const uint8_t *data, size_t len) {
if (strcmp(excludeList[e].type.data, (char *)"public-key") != 0) { if (strcmp(excludeList[e].type.data, (char *)"public-key") != 0) {
continue; continue;
} }
Credential ecred; Credential ecred = {0};
if (credential_load(excludeList[e].id.data, excludeList[e].id.len, rp_id_hash, if (credential_load(excludeList[e].id.data, excludeList[e].id.len, rp_id_hash,
&ecred) == 0 && &ecred) == 0 &&
(ecred.extensions.credProtect != CRED_PROT_UV_REQUIRED || (ecred.extensions.credProtect != CRED_PROT_UV_REQUIRED ||