Skip to content

Commit

Permalink
Clean data before setting them
Browse files Browse the repository at this point in the history
  • Loading branch information
viveks committed Feb 7, 2024
1 parent 1a029fc commit 066f553
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,17 +749,24 @@ parse_attobj(const cbor_item_t *key, const cbor_item_t *val, void *arg)
}

if (!strcmp(name, "fmt")) {
free(cred->fmt);
cred->fmt = NULL;

if (cbor_decode_fmt(val, &cred->fmt) < 0) {
fido_log_debug("%s: cbor_decode_fmt", __func__);
goto fail;
}
} else if (!strcmp(name, "attStmt")) {
fido_cred_clean_attstmt(&cred->attstmt);

if (cbor_decode_attstmt(val, &cred->attstmt) < 0) {
fido_log_debug("%s: cbor_decode_attstmt", __func__);
goto fail;
}
}
else if (!strcmp(name, "authData")) {
fido_cred_clean_authdata(cred);

if (fido_blob_decode(val, &cred->authdata_raw) < 0) {
fido_log_debug("%s: fido_blob_decode", __func__);
goto fail;
Expand Down

0 comments on commit 066f553

Please sign in to comment.