Fix remaining corner cases after lib_nbgl audit
nbgl_layout_keypad.c: type confusion in nbgl_layoutUpdateHiddenDigits When nbActive == nbDigits, children[nbActive] points to the underline LINE object, not a digit IMAGE. Reinterpreting and writing its foregroundColor field caused silent struct-field corruption. Added a type guard that treats a non-IMAGE child as "all digits active" and returns 0. nbgl_layout_keyboard.c: missing NULL checks in nbgl_layoutUpdateKeyboardContent mainContainer and its inner text-entry container were dereferenced without NULL or type guards. suggestionsContainer (children[1] in the KEYBOARD_WITH_SUGGESTIONS path) was also unchecked. nbgl_use_case.c: missing LOG_WARN before existing NULL return in nbgl_useCaseAdvancedChoiceWithDetails The bounds check was present but silent; adding the log for consistency with all other use-case entry points. nbgl_use_case_nanos.c: missing LOG_WARN before existing NULL return in getContentPage Same pattern: p_content == NULL check was present but produced no diagnostic.
C
Charles-Edouard de la Vergne committed
9f7444de0454cae8da06b86fe7a8e079453d2e66
Parent: 5ee26ed