From 25dc0d1de6e7770ff1109a434965fcff5202595d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Dec 2021 18:03:40 +0200 Subject: [PATCH] ; Another protection from out-of-bounds access to it->stack[]. --- src/xdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 45b502590d1..0ff6286af74 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -30289,7 +30289,8 @@ produce_stretch_glyph (struct it *it) Compute the width of the characters having this `display' property. */ struct it it2; - Lisp_Object object = it->stack[it->sp - 1].string; + Lisp_Object object = + it->sp > 0 ? it->stack[it->sp - 1].string : it->string; unsigned char *p = (STRINGP (object) ? SDATA (object) + IT_STRING_BYTEPOS (*it) : BYTE_POS_ADDR (IT_BYTEPOS (*it))); -- 2.39.5