[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 509dec9: Fix out-of-bounds access in xdisp.c
From: |
Eli Zaretskii |
Subject: |
master 509dec9: Fix out-of-bounds access in xdisp.c |
Date: |
Sun, 5 Dec 2021 10:35:25 -0500 (EST) |
branch: master
commit 509dec902c45bc11cd8ff6664795b471d451742c
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
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 <luangruo@yahoo.com>.
---
src/xdisp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index b2eeb11..45b5025 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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 509dec9: Fix out-of-bounds access in xdisp.c,
Eli Zaretskii <=