From ddc2dd16121b10da129d363530a365361435a849 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Wed, 22 Mar 2017 20:34:27 -0400 Subject: [PATCH] Ensure an item exists on the rpcconsole stack before adding Ensures that there is an item on the rpcconsole stack before adding something to the current stack so that a segmentation fault does not occur. Github-Pull: #10060 Rebased-From: 4df76e270caa9d828179cae1c7a8918d6f91ec21 --- src/qt/rpcconsole.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 60406c205..001f19926 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -175,6 +175,10 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string & nDepthInsideSensitive = 1; filter_begin_pos = chpos; } + // Make sure stack is not empty before adding something + if (stack.empty()) { + stack.push_back(std::vector()); + } stack.back().push_back(strArg); };