Browse Source

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: 4df76e270c
0.14
Andrew Chow 8 years ago committed by MarcoFalke
parent
commit
ddc2dd1612
  1. 4
      src/qt/rpcconsole.cpp

4
src/qt/rpcconsole.cpp

@ -175,6 +175,10 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string & @@ -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);
};

Loading…
Cancel
Save