From f349c7dc009ca7124834f4c0591c8801945602f3 Mon Sep 17 00:00:00 2001 From: Albert S Date: Mon, 5 Nov 2018 10:46:06 +0100 Subject: [PATCH] Parser: Fix segfault in command extraction --- parser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parser.cpp b/parser.cpp index 6b5661f..536bbde 100644 --- a/parser.cpp +++ b/parser.cpp @@ -72,7 +72,11 @@ std::string Parser::extractCommand(std::string cmdname, std::string content) con if(std::regex_match(content, match, reg)) { - return match.str(2); + if(match.size() > 1) + { + return match.str(2); + + } } return ""; }