From b7b740a04c3f599c518bdfa606812e75acfc9d80 Mon Sep 17 00:00:00 2001 From: Sigrid Date: Mon, 28 Dec 2020 21:21:22 +0100 Subject: text2post: check font index for out of range --- sys/src/cmd/postscript/text2post/text2post.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/src/cmd/postscript/text2post/text2post.c b/sys/src/cmd/postscript/text2post/text2post.c index 963911305..b8f87994b 100644 --- a/sys/src/cmd/postscript/text2post/text2post.c +++ b/sys/src/cmd/postscript/text2post/text2post.c @@ -325,6 +325,11 @@ txt2post(void) { 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(); -- cgit v1.2.3