Skip to content

Commit 6903c73

Browse files
authored
fix(legacy): fix near issue (#459)
1 parent dd3a864 commit 6903c73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

legacy/firmware/near.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int parse_transaction(const NearSignTx *msg, uint32_t *processed,
251251
if (borsh_read_buffer(msg, &len, (const uint8_t **)&var_name, processed)) {
252252
return -1;
253253
}
254-
if (var_name == NULL || len != 64) {
254+
if (var_name == NULL || len > 64 || len < 2) {
255255
return -1;
256256
}
257257
strcpy_ellipsis(sizeof(singer), singer, len, var_name);
@@ -268,7 +268,7 @@ static int parse_transaction(const NearSignTx *msg, uint32_t *processed,
268268
if (borsh_read_buffer(msg, &len, (const uint8_t **)&var_name, processed)) {
269269
return -1;
270270
}
271-
if (var_name == NULL || len != 64) {
271+
if (var_name == NULL || len > 64 || len < 2) {
272272
return -1;
273273
}
274274
strcpy_ellipsis(sizeof(singer), singer, len, var_name);

0 commit comments

Comments
 (0)