patch 9.2.0528: possible overflow in XIM resource handling

Problem:  possible overflow in XIM resource handling
          (Venukamatchi)
Solution: use vim_strncpy() with the buffer size

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2026-05-24 16:47:27 +00:00
parent 07c8b4712f
commit 31c739458a
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -1750,7 +1750,8 @@ xim_real_init(Window x11_window, Display *x11_display)
if (gui.rsrc_input_method != NULL && *gui.rsrc_input_method != NUL)
{
strcpy(tmp, gui.rsrc_input_method);
vim_strncpy((char_u *)tmp, (char_u *)gui.rsrc_input_method,
sizeof(tmp) - 1);
for (ns = s = tmp; ns != NULL && *s != NUL;)
{
s = (char *)skipwhite((char_u *)s);
@@ -1817,7 +1818,8 @@ xim_real_init(Window x11_window, Display *x11_display)
}
found = False;
strcpy(tmp, gui.rsrc_preedit_type_name);
vim_strncpy((char_u *)tmp, (char_u *)gui.rsrc_preedit_type_name,
sizeof(tmp) - 1);
for (s = tmp; s && !found; )
{
while (*s && SAFE_isspace(*s))
+2
View File
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
528,
/**/
527,
/**/