aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2017-03-22 20:34:27 -0400
committerMarcoFalke <falke.marco@gmail.com>2017-03-27 23:08:24 +0200
commitddc2dd16121b10da129d363530a365361435a849 (patch)
treeb6e6c8ec1701830b7b79a6c8894b5e27f4d6de91
parent4d8e66017f6d6498df53935bc9a754d4317a2293 (diff)
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
-rw-r--r--src/qt/rpcconsole.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 60406c2059..001f199264 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<std::string>());
+ }
stack.back().push_back(strArg);
};