diff options
| author | Andrew Chow <[email protected]> | 2017-03-22 20:34:27 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2017-03-27 23:08:24 +0200 |
| commit | ddc2dd16121b10da129d363530a365361435a849 (patch) | |
| tree | b6e6c8ec1701830b7b79a6c8894b5e27f4d6de91 | |
| parent | Trivial: Fix typo in help getrawtransaction RPC (diff) | |
| download | discoin-ddc2dd16121b10da129d363530a365361435a849.tar.xz discoin-ddc2dd16121b10da129d363530a365361435a849.zip | |
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.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<std::string>()); + } stack.back().push_back(strArg); }; |