From: Eli Zaretskii Date: Sun, 5 Dec 2021 16:03:40 +0000 (+0200) Subject: ; Another protection from out-of-bounds access to it->stack[]. X-Git-Tag: emacs-29.0.90~3612^2~3^2~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25dc0d1de6e7770ff1109a434965fcff5202595d;p=emacs.git ; Another protection from out-of-bounds access to it->stack[]. --- 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)));