diff options
-rw-r--r-- | bas.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -316,6 +316,10 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) { lineno = tmpno; offset = program[linepos + 2]; nextpos = linepos + offset; + if(nextpos > filelen) { + fprintf(stderr, "Warning: program truncated in the middle of line %d.\n", lineno); + return; + } end = nextpos; pos = linepos; |