diff options
| author | Eli Zaretskii | 2021-12-05 17:34:05 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-12-05 17:34:05 +0200 |
| commit | 509dec902c45bc11cd8ff6664795b471d451742c (patch) | |
| tree | 4b53a6a6d16d40ffef5afa1a089ac5327caf4019 /src | |
| parent | 622550f7187f5ec9261a0d30b5ee6f440069a1e0 (diff) | |
| download | emacs-509dec902c45bc11cd8ff6664795b471d451742c.tar.gz emacs-509dec902c45bc11cd8ff6664795b471d451742c.zip | |
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>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
| 30391 | if (width > 0 && height > 0 && it->glyph_row) | 30391 | if (width > 0 && height > 0 && it->glyph_row) |
| 30392 | { | 30392 | { |
| 30393 | Lisp_Object o_object = it->object; | 30393 | Lisp_Object o_object = it->object; |
| 30394 | Lisp_Object object = it->stack[it->sp - 1].string; | 30394 | Lisp_Object object = |
| 30395 | it->sp > 0 ? it->stack[it->sp - 1].string : it->string; | ||
| 30395 | int n = width; | 30396 | int n = width; |
| 30396 | 30397 | ||
| 30397 | if (!STRINGP (object)) | 30398 | if (!STRINGP (object)) |