mirror of
https://github.com/vim/vim.git
synced 2025-11-16 23:24:03 -05:00
patch 9.1.1339: missing out-of-memory checks for enc_to_utf16()/utf16_to_enc()
Problem: missing out-of-memory checks for enc_to_utf16() and
utf16_to_enc()
Solution: Add out-of-memory checks and fix a few other minor issues
(John Marriott)
This change does:
- add missing out-of-memory checks for enc_to_utf16() and
utf16_to_enc()
- add a small optimisation in mch_errmsg_c() and mch_msg_c() (in
message.c) to only call STRLEN() if needed.
- fix a memory leak in winpty_term_and_job_init() (in terminal.c).
closes: #17191
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ec270a5f55
commit
031f2273cb
@@ -3180,10 +3180,12 @@ get_logfont(
|
||||
if (cp->name == NULL && verbose)
|
||||
{
|
||||
char_u *s = utf16_to_enc(p, NULL);
|
||||
|
||||
semsg(_(e_illegal_str_name_str_in_font_name_str),
|
||||
"charset", s, name);
|
||||
vim_free(s);
|
||||
if (s != NULL)
|
||||
{
|
||||
semsg(_(e_illegal_str_name_str_in_font_name_str),
|
||||
"charset", s, name);
|
||||
vim_free(s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -3202,9 +3204,12 @@ get_logfont(
|
||||
if (qp->name == NULL && verbose)
|
||||
{
|
||||
char_u *s = utf16_to_enc(p, NULL);
|
||||
semsg(_(e_illegal_str_name_str_in_font_name_str),
|
||||
"quality", s, name);
|
||||
vim_free(s);
|
||||
if (s != NULL)
|
||||
{
|
||||
semsg(_(e_illegal_str_name_str_in_font_name_str),
|
||||
"quality", s, name);
|
||||
vim_free(s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user