Skip to content

Commit

Permalink
Fixed a array out of bounds access error (when current state is -1) s…
Browse files Browse the repository at this point in the history
…etting the initial state.
  • Loading branch information
laszlo-kiss committed Feb 12, 2017
1 parent acf1b0e commit d0cd1a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FSM/FiniteStateMachine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ namespace Core
throw Exception("Out of bounds state id number.");
}

if ( state_table[current_state]->IsStoringForwarding() )
if ( current_state != SentinelStateID && state_table[current_state]->IsStoringForwarding() )
{
// Clear any stored events since this method essentially acts as
// a state machine reset function.
Expand Down

0 comments on commit d0cd1a6

Please sign in to comment.