theandrew168 / derzforth

Bare-metal Forth implementation for RISC-V
MIT License
42 stars 5 forks source link

Perform bounds check on TBUF to prevent 1KB buffer from overflowing #14

Closed aw closed 2 years ago

aw commented 2 years ago

As the title suggests, this PR adds bounds check on TBUF to ensure it doesn't overflow.

I tested this by changing TIB_SIZE to 0x0002 and confirmed only 2 characters can be added to the buffer. After typing the third character, an error is returned.