Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[glass] FMS: Fix reading past end of GSM buffer
  • Loading branch information
PeterJohnson committed Oct 1, 2025
commit e2d0da39499c4a0c508e34dfd383b1583210689b
13 changes: 8 additions & 5 deletions glass/src/lib/native/cpp/other/FMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading