diff --git a/src_features/signMessageEIP712/path.c b/src_features/signMessageEIP712/path.c index 4381280..cf0f1e5 100644 --- a/src_features/signMessageEIP712/path.c +++ b/src_features/signMessageEIP712/path.c @@ -255,6 +255,7 @@ static bool array_depth_list_push(uint8_t path_idx, uint8_t size) { arr = &path_struct->array_depths[path_struct->array_depth_count]; arr->path_index = path_idx; arr->size = size; + arr->index = 0; path_struct->array_depth_count += 1; return true; } @@ -559,8 +560,8 @@ static bool path_advance_in_array(void) { if ((path_struct->array_depth_count > 0) && (arr_depth->path_index == (path_struct->depth_count - 1))) { - if (arr_depth->size > 0) arr_depth->size -= 1; - if (arr_depth->size == 0) { + arr_depth->index += 1; + if (arr_depth->index == arr_depth->size) { array_depth_list_pop(); end_reached = true; } else { diff --git a/src_features/signMessageEIP712/path.h b/src_features/signMessageEIP712/path.h index b7a31cb..2181561 100644 --- a/src_features/signMessageEIP712/path.h +++ b/src_features/signMessageEIP712/path.h @@ -12,6 +12,7 @@ typedef struct { uint8_t path_index; uint8_t size; + uint8_t index; } s_array_depth; typedef enum { ROOT_DOMAIN, ROOT_MESSAGE } e_root_type;