mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05: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.
This commit is contained in:
parent
02d64bd929
commit
4df76e270c
1 changed files with 4 additions and 0 deletions
|
@ -175,6 +175,10 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &
|
||||||
nDepthInsideSensitive = 1;
|
nDepthInsideSensitive = 1;
|
||||||
filter_begin_pos = chpos;
|
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);
|
stack.back().push_back(strArg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue