Skip to content

Commit fa8a995

Browse files
committed
Cheats: Fix uninitialized data read in parsing
1 parent fb60691 commit fa8a995

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/cheats.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ void Cheats::ParseFile(CheatCodeList* dst_list, const std::string_view file_cont
13881388
CheatFileReader reader(file_contents);
13891389

13901390
std::string_view next_code_group;
1391-
CheatCode::Metadata next_code_metadata;
1391+
CheatCode::Metadata next_code_metadata = {};
13921392
bool next_code_ignored = false;
13931393
std::optional<size_t> code_body_start;
13941394

@@ -1397,7 +1397,7 @@ void Cheats::ParseFile(CheatCodeList* dst_list, const std::string_view file_cont
13971397
if (!code_body_start.has_value())
13981398
{
13991399
WARNING_LOG("Empty cheat body at line {}", reader.GetCurrentLineNumber());
1400-
next_code_metadata = CheatCode::Metadata();
1400+
next_code_metadata = {};
14011401
return;
14021402
}
14031403

@@ -1423,7 +1423,7 @@ void Cheats::ParseFile(CheatCodeList* dst_list, const std::string_view file_cont
14231423
}
14241424

14251425
next_code_group = {};
1426-
next_code_metadata = CheatCode::Metadata();
1426+
next_code_metadata = {};
14271427
code_body_start.reset();
14281428
if (std::exchange(next_code_ignored, false))
14291429
return;

0 commit comments

Comments
 (0)