Skip to content

Commit

Permalink
Ensure an item exists on the rpcconsole stack before adding
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
achow101 committed Mar 25, 2017
1 parent 02d64bd commit 4df76e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 4df76e2

Please sign in to comment.