From e83d5073baad3c4f6817357711fb3ba7626615dc Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 11 Jun 2020 14:48:18 -0400 Subject: [PATCH] VE: disallow buffer overflow during typing When reaching the end of the buffer when typing in IBUF or FBUF, stop typing instead of overflowing. --- blk/127 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blk/127 b/blk/127 index 9b5b11d..96f7d72 100644 --- a/blk/127 +++ b/blk/127 @@ -6,5 +6,5 @@ : buftype ( buf ln -- ) 3 OVER AT-XY C< DUP 0xd = IF 2DROP DROP EXIT THEN ( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c ) - SWAP DUP _zbuf BEGIN ( c a ) - C!+ C< TUCK 0x0d = UNTIL ( c a ) C! ; + SWAP DUP _zbuf C!+ DUP 63 + SWAP DO + C< DUP 0x0d = IF LEAVE THEN i C! LOOP ;