Skip to content

Commit

Permalink
Merge pull request #824 from LedgerHQ/abo_check_null_pointer
Browse files Browse the repository at this point in the history
NBGL Nano: Check onActionCallback validity
  • Loading branch information
abonnaudet-ledger authored Nov 15, 2024
2 parents fe9d203 + 263df08 commit c56add3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib_nbgl/src/nbgl_step.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ static void actionCallback(nbgl_layout_t *layout, nbgl_buttonEvent_t event)
}
else if ((ctx->textContext.pos == LAST_STEP)
|| (ctx->textContext.pos == NEITHER_FIRST_NOR_LAST_STEP)) {
ctx->textContext.onActionCallback((nbgl_step_t) ctx, event);
if (ctx->textContext.onActionCallback != NULL) {
ctx->textContext.onActionCallback((nbgl_step_t) ctx, event);
}
}
}
else if (event == BUTTON_RIGHT_PRESSED) {
Expand All @@ -319,11 +321,15 @@ static void actionCallback(nbgl_layout_t *layout, nbgl_buttonEvent_t event)
}
else if ((ctx->textContext.pos == FIRST_STEP)
|| (ctx->textContext.pos == NEITHER_FIRST_NOR_LAST_STEP)) {
ctx->textContext.onActionCallback((nbgl_step_t) ctx, event);
if (ctx->textContext.onActionCallback != NULL) {
ctx->textContext.onActionCallback((nbgl_step_t) ctx, event);
}
}
}
else if (event == BUTTON_BOTH_PRESSED) {
ctx->textContext.onActionCallback((nbgl_step_t) ctx, event);
if (ctx->textContext.onActionCallback != NULL) {
ctx->textContext.onActionCallback((nbgl_step_t) ctx, event);
}
}
}

Expand Down

0 comments on commit c56add3

Please sign in to comment.