From: Eli Zaretskii Date: Sun, 5 Dec 2021 15:34:05 +0000 (+0200) Subject: Fix out-of-bounds access in xdisp.c X-Git-Tag: emacs-29.0.90~3612^2~3^2~15 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=509dec902c45bc11cd8ff6664795b471d451742c;p=emacs.git Fix out-of-bounds access in xdisp.c * src/xdisp.c (produce_stretch_glyph): Avoid indexing it->stack with a negative index. Reported by Po Lu . --- diff --git a/src/xdisp.c b/src/xdisp.c index b2eeb1105b1..45b502590d1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -30391,7 +30391,8 @@ produce_stretch_glyph (struct it *it) if (width > 0 && height > 0 && it->glyph_row) { Lisp_Object o_object = it->object; - Lisp_Object object = it->stack[it->sp - 1].string; + Lisp_Object object = + it->sp > 0 ? it->stack[it->sp - 1].string : it->string; int n = width; if (!STRINGP (object))