summaryrefslogtreecommitdiffstats
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-02 12:37:37 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-02 12:37:37 +0100
commit1cbfc9914db1cb06aaa092fa42eb7a2fc3dc7ad7 (patch)
tree2d006290346b32cd411080d3087a84d8a49e08b6 /src/message.c
parenta452b808b4da2d272ca4a50865eb8ca89a58f239 (diff)
patch 8.2.2078: illegal memory access when using :print on invalid textv8.2.2078
Problem: Illegal memory access when using :print on invalid text. (Dhiraj Mishra) Solution: Check for more composing characters than supported. (closes #7399)
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/message.c b/src/message.c
index f8efabc80d..3f6d56e5de 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1859,7 +1859,11 @@ msg_prt_line(char_u *s, int list)
else if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1)
{
col += (*mb_ptr2cells)(s);
- if (lcs_nbsp != NUL && list
+ if (l >= MB_MAXBYTES)
+ {
+ STRCPY(buf, "¿");
+ }
+ else if (lcs_nbsp != NUL && list
&& (mb_ptr2char(s) == 160
|| mb_ptr2char(s) == 0x202f))
{