Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix segfault when invalid command issued.

First check if we actually find an entry inside the action map before
working on it further.
  • Loading branch information...
commit 5ae68eb643bb3e8e8735cb3f5628ec32771bb97e 1 parent b08fafb
@vodik vodik authored committed
Showing with 3 additions and 0 deletions.
  1. +3 −0  ponymix.cc
View
3  ponymix.cc
@@ -456,6 +456,9 @@ static const std::pair<const string, const Command>& string_to_command(
};
const auto match = actionmap.lower_bound(str);
+ if (match == actionmap.end()) {
+ errx(1, "error: Invalid action specified: %s", str);
+ }
// Check for exact match
if (match->first == str) {
Please sign in to comment.
Something went wrong with that request. Please try again.