mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Fix heap-use-after-free
This commit is contained in:
committed by
Dennis Klein
parent
4fdf9d340b
commit
ac3293fcc6
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user