diff --git a/ion/src/simulator/shared/state_file.cpp b/ion/src/simulator/shared/state_file.cpp index 57057cfe8..9c23ba0bc 100644 --- a/ion/src/simulator/shared/state_file.cpp +++ b/ion/src/simulator/shared/state_file.cpp @@ -40,7 +40,10 @@ static inline bool load(FILE * f) { int c = 0; while ((c = getc(f)) != EOF) { Ion::Events::Event e = Ion::Events::Event(c); - journal->pushEvent(e); + if (e.isDefined() && e.isKeyboardEvent()) { + // Avoid pushing invalid events - useful when fuzzing + journal->pushEvent(e); + } } Ion::Events::replayFrom(journal);