Skip to content

Commit

Permalink
Merge pull request #825 from LedgerHQ/abo_update_api_22_check_null_ptr
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 598aafa + 3355db0 commit 49a5886
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 49a5886

Please sign in to comment.