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)
This commit is contained in:
parent
0278741676
commit
16fed05ba8
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue