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
4fdf9d340b
commit
ac3293fcc6
|
@ -392,10 +392,10 @@ void Cmds::Deserialize(const string& str, const Format type)
|
||||||
|
|
||||||
const flatbuffers::Vector<flatbuffers::Offset<FBCommand>>* cmds = nullptr;
|
const flatbuffers::Vector<flatbuffers::Offset<FBCommand>>* cmds = nullptr;
|
||||||
|
|
||||||
|
flatbuffers::Parser parser;
|
||||||
if (type == Format::Binary) {
|
if (type == Format::Binary) {
|
||||||
cmds = cmd::GetFBCommands(const_cast<char*>(str.c_str()))->commands();
|
cmds = cmd::GetFBCommands(const_cast<char*>(str.c_str()))->commands();
|
||||||
} else { // Type == Format::JSON
|
} else { // Type == Format::JSON
|
||||||
flatbuffers::Parser parser;
|
|
||||||
if (!parser.Parse(commandsFormatDefFbs)) {
|
if (!parser.Parse(commandsFormatDefFbs)) {
|
||||||
throw CommandFormatError("Deserialize couldn't parse commands format");
|
throw CommandFormatError("Deserialize couldn't parse commands format");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user