From 9ccb4e036c2de27126624498e2441faea3004d1f Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Sat, 27 Feb 2021 15:05:12 -0500 Subject: Init selected_app in home_menu to a default value When the value references an out of bounds memory address, line 47 in same file may cause hardfault/segmentation fault. --- apps/home_menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/home_menu.cpp b/apps/home_menu.cpp index 19458e6..c261611 100644 --- a/apps/home_menu.cpp +++ b/apps/home_menu.cpp @@ -81,8 +81,8 @@ namespace app_home_menu { // Initlisation of the app. int init(Api *app_api) { - pressed_button = new char; *pressed_button = '*'; - selected_app = new int; + pressed_button = new char; *pressed_button = '*'; + selected_app = new int; *selected_app = 0; // Make sure to init the values to something known! return 0; // return 1 when function not implemented } -- cgit v1.2.3-54-g00ecf