Skip to content

Commit 4df76e2

Browse files
committed
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.
1 parent 02d64bd commit 4df76e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/qt/rpcconsole.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &
175175
nDepthInsideSensitive = 1;
176176
filter_begin_pos = chpos;
177177
}
178+
// Make sure stack is not empty before adding something
179+
if (stack.empty()) {
180+
stack.push_back(std::vector<std::string>());
181+
}
178182
stack.back().push_back(strArg);
179183
};
180184

0 commit comments

Comments
 (0)