fix: Potential out of bounds access of flightmode name on main screen (#1337)

* fixed incorrect use of non-terminated-fixed-string for ctor of std::string

* introduced helper

* removed commented lines
This commit is contained in:
Wilhelm
2022-01-10 09:28:47 +10:00
committed by GitHub
parent d30c5f46bc
commit 1b6f827b2c
2 changed files with 8 additions and 2 deletions
@@ -328,8 +328,8 @@ void ViewMainDecoration::createFlightMode()
};
std::function<std::string()> getFM = []() -> std::string {
return g_model.flightModeData[mixerCurrentFlightMode].name;
};
return stringFromNtString(g_model.flightModeData[mixerCurrentFlightMode].name);
};
flightMode = new DynamicText(this, r, getFM, CENTERED | COLOR_THEME_SECONDARY1);
}