emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 16fed05: Avoid crashes on TTY frames with over-long composition


From: Eli Zaretskii
Subject: emacs-27 16fed05: Avoid crashes on TTY frames with over-long compositions
Date: Tue, 28 Apr 2020 05:01:06 -0400 (EDT)

branch: emacs-27
commit 16fed05ba85c3d92d3c913657dd50a648ad3884a
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid crashes on TTY frames with over-long compositions
    
    * src/term.c (encode_terminal_code): Each character from an
    automatic composition is a multibyte character, so its multibyte
    representation can take up to MAX_MULTIBYTE_LENGTH bytes.
    Account for that when allocating storage for characters to be
    encoded.  (Bug#40913)
---
 src/term.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/term.c b/src/term.c
index a3aef31..94bf013 100644
--- a/src/term.c
+++ b/src/term.c
@@ -563,8 +563,8 @@ encode_terminal_code (struct glyph *src, int src_len,
            {
              cmp = composition_table[src->u.cmp.id];
              required = cmp->glyph_len;
-             required *= MAX_MULTIBYTE_LENGTH;
            }
+         required *= MAX_MULTIBYTE_LENGTH;
 
          if (encode_terminal_src_size - nbytes < required)
            {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]