From: Nathaniel Wesley Filardo Date: Sat, 7 Nov 2015 05:38:40 +0000 (-0500) Subject: Add sanity check panic for CRTC interactions X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=86c10e34e8f2ae18b8c52ac63cbcb7e120e58f5b;p=xv6-public Add sanity check panic for CRTC interactions --- diff --git a/console.c b/console.c index a017e3a..f11abf3 100644 --- a/console.c +++ b/console.c @@ -149,6 +149,9 @@ cgaputc(int c) if(pos > 0) --pos; } else crt[pos++] = (c&0xff) | 0x0700; // black on white + + if(pos > 25*80) + panic("pos overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80);