mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-24 22:39:31 +00:00
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
This commit is contained in:
parent
4d8e66017f
commit
ddc2dd1612
@ -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…
x
Reference in New Issue
Block a user