git: 9front

Download patch

ref: c2c344700b65623180490a5662725b761c65694a
parent: 4b9a5507c4e447a4a4a6facd041de39bb74db6fd
author: Sigrid <ftrvxmtrx@gmail.com>
date: Mon Dec 28 16:21:22 EST 2020

text2post: check font index for out of range

--- a/sys/src/cmd/postscript/text2post/text2post.c
+++ b/sys/src/cmd/postscript/text2post/text2post.c
@@ -325,6 +325,11 @@
 		thischar = r & 0xff;
 		thisfont = (r>>8) & 0xff;
 
+		if (thisfont >= FONTABSIZE) {
+			Bprint(Bstderr, "font out of range\n");
+			exits("font");
+		}
+
 		if (line_no == 0 && char_no == 0)
 			startpage();
 
--