mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Fix heap-use-after-free
This commit is contained in:
parent
2edf61c5a2
commit
6f190e7182
|
@ -392,10 +392,10 @@ void Cmds::Deserialize(const string& str, const Format type)
|
|||
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FBCommand>>* cmds = nullptr;
|
||||
|
||||
flatbuffers::Parser parser;
|
||||
if (type == Format::Binary) {
|
||||
cmds = cmd::GetFBCommands(const_cast<char*>(str.c_str()))->commands();
|
||||
} else { // Type == Format::JSON
|
||||
flatbuffers::Parser parser;
|
||||
if (!parser.Parse(commandsFormatDefFbs)) {
|
||||
throw CommandFormatError("Deserialize couldn't parse commands format");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user