shithub: drawterm

Download patch

ref: 2f3f38b844da4296ea6dddab4ac4936d012ad047
parent: e10ae98365bfd6d4f0cfb67304e32a5f16483f7d
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jul 20 15:03:57 EDT 2017

fix bounds check in screenputc() (thanks mischief)

--- a/kern/term.c	Fri May 19 19:27:30 2017
+++ b/kern/term.c	Thu Jul 20 15:03:57 2017
@@ -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]) {