From 6f190e7182bd9f07ea19b208374d10706ceb44ec Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Thu, 24 Jun 2021 11:19:06 +0200 Subject: [PATCH] Fix heap-use-after-free --- fairmq/sdk/commands/Commands.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fairmq/sdk/commands/Commands.cxx b/fairmq/sdk/commands/Commands.cxx index b250264e..0d79d962 100644 --- a/fairmq/sdk/commands/Commands.cxx +++ b/fairmq/sdk/commands/Commands.cxx @@ -392,10 +392,10 @@ void Cmds::Deserialize(const string& str, const Format type) const flatbuffers::Vector>* cmds = nullptr; + flatbuffers::Parser parser; if (type == Format::Binary) { cmds = cmd::GetFBCommands(const_cast(str.c_str()))->commands(); } else { // Type == Format::JSON - flatbuffers::Parser parser; if (!parser.Parse(commandsFormatDefFbs)) { throw CommandFormatError("Deserialize couldn't parse commands format"); }