Skip to content

Commit

Permalink
src/checks.c: Use correct install_parameters length
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Nov 27, 2023
1 parent 191b74b commit 0d391f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion include/checks.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#define CHECK_NOT_AUDITED_TLV_TAG 0x9F
#define CHECK_NOT_AUDITED_TLV_VAL 0x01
#define CHECK_NOT_AUDITED_MAX_LEN 0x40

void check_audited_app(void);
#endif // !defined(HAVE_BOLOS) && defined(HAVE_PENDING_REVIEW_SCREEN)
Expand Down
4 changes: 3 additions & 1 deletion src/checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

// This label ultimately comes from the application link.
extern unsigned int const _install_parameters;
extern unsigned int const _einstall_parameters;

#ifdef HAVE_BAGL

Expand Down Expand Up @@ -173,8 +174,9 @@ void check_audited_app(void)
{
unsigned char data = BOLOS_FALSE;
unsigned char *buffer = &data;
unsigned int install_parameters_len = (unsigned char *)&_einstall_parameters - (unsigned char *)&_install_parameters;
unsigned int length = os_parse_bertlv((unsigned char *) (&_install_parameters),
CHECK_NOT_AUDITED_MAX_LEN,
install_parameters_len,
NULL,
CHECK_NOT_AUDITED_TLV_TAG,
0x00,
Expand Down

0 comments on commit 0d391f7

Please sign in to comment.