Skip to content

Commit

Permalink
Fix '.echo >0' crash in first pass
Browse files Browse the repository at this point in the history
When run_first_pass_line / run_first_pass_line_sec changes the ptr
to NULL, run_first_pass does not check for this and attempts to
dereference the NULL ptr, causing a crash. Adding a NULL check and
breaking out of the loops fixes this!

Fixes one of the fuzzed lines in #43.
  • Loading branch information
alberthdev committed Mar 25, 2017
1 parent ac310f3 commit f87fbb9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pass_one.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ void run_first_pass (char *ptr) {
do_listing_for_line (ptr);

line_num++;
} else {
// Nothing more to read, return
break;
}
}
}
Expand Down

0 comments on commit f87fbb9

Please sign in to comment.