shithub: drawterm

Download patch

ref: 2f3f38b844da4296ea6dddab4ac4936d012ad047
parent: e10ae98365bfd6d4f0cfb67304e32a5f16483f7d
author: cinap_lenrek <[email protected]>
date: Thu Jul 20 17:03:57 EDT 2017

fix bounds check in screenputc() (thanks mischief)

--- a/kern/term.c
+++ b/kern/term.c
@@ -125,7 +125,7 @@
 	static int *xp;
 	static int xbuf[256];
 
-	if(xp < xbuf || xp >= &xbuf[sizeof(xbuf)])
+	if(xp < xbuf || xp >= &xbuf[nelem(xbuf)])
 		xp = xbuf;
 
 	switch(buf[0]) {