mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[glass] FMS: Fix reading past end of GSM buffer (#8268)
This commit is contained in:
@@ -148,11 +148,14 @@ void glass::DisplayFMSReadOnly(FMSModel* model) {
|
||||
ImGui::TextUnformatted("?");
|
||||
}
|
||||
}
|
||||
|
||||
wpi::SmallString<64> gameSpecificMessageBuf;
|
||||
std::string_view gameSpecificMessage =
|
||||
model->GetGameSpecificMessage(gameSpecificMessageBuf);
|
||||
ImGui::Text("Game Specific: %s", exists ? gameSpecificMessage.data() : "?");
|
||||
if (exists) {
|
||||
wpi::SmallString<64> gsmBuf;
|
||||
std::string_view gsm = model->GetGameSpecificMessage(gsmBuf);
|
||||
ImGui::Text("Game Specific: %.*s", static_cast<int>(gsm.size()),
|
||||
gsm.data());
|
||||
} else {
|
||||
ImGui::TextUnformatted("Game Specific: ?");
|
||||
}
|
||||
|
||||
if (!exists) {
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
Reference in New Issue
Block a user