Skip to content

Commit

Permalink
Added missing error-handling in EIP-712 type_hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
apaillier-ledger committed Sep 2, 2024
1 parent 142d6e0 commit 986162e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src_features/signMessageEIP712/type_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ static const void **get_struct_dependencies(uint8_t *const deps_count,
// get struct name
arg_structname = get_struct_field_typename(field_ptr, &arg_structname_length);
// from its name, get the pointer to its definition
arg_struct_ptr = get_structn(arg_structname, arg_structname_length);
if ((arg_struct_ptr = get_structn(arg_structname, arg_structname_length)) == NULL) {
PRINTF("Error: could not find EIP-712 struct \"");
for (int i = 0; i < arg_structname_length; ++i) PRINTF("%c", arg_structname[i]);
PRINTF("\" during type_hash\n");
return NULL;
}

// check if it is not already present in the dependencies array
for (dep_idx = 0; dep_idx < *deps_count; ++dep_idx) {
Expand Down

0 comments on commit 986162e

Please sign in to comment.