From a13e921b196a2be691af256520877e4020a04f0c Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 14 Jul 2024 03:25:11 -0400 Subject: bas.c: don't allow null bytes in variable name table, except at the end. --- bas.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bas.c b/bas.c index ab02b28..6be34f7 100644 --- a/bas.c +++ b/bas.c @@ -207,8 +207,9 @@ int vntable_ok(void) { while(vp < vvstart) { unsigned char c = program[vp]; - /* treat a null byte as end-of-table, ignore any junk between it and VNTP. */ - if(c == 0) break; + /* allow for (but don't require) dummy byte at VNTD. used to just + quit when we hit 0, but 0 might be part of a scrambled table. */ + if(c == 0 && vp == (vvstart - 1)) break; vp++; -- cgit v1.2.3