patch 9.1.2113: potential NULL pointer dereference issues

Problem:  potential NULL pointer dereference issues
          (EpheraXun)
Solution: Check returned pointer to be non NULL.
          (Yasuhiro Matsumoto)

fixes:  #19273
closes: #19274

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yasuhiro Matsumoto
2026-01-29 18:43:12 +00:00
committed by Christian Brabandt
parent 7599a18997
commit d0502fdb26
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ server_to_input_buf(char_u *str)
str = replace_termcodes(str, &ptr, 0, REPTERM_DO_LT, NULL);
p_cpo = cpo_save;
if (*ptr != NUL) // trailing CTRL-V results in nothing
if (ptr != NULL && *ptr != NUL) // trailing CTRL-V results in nothing
{
/*
* Add the string to the input stream.
+9 -1
View File
@@ -1482,9 +1482,17 @@ term_mouse_click(VTerm *vterm, int key)
// For modeless selection mouse drag and release events are ignored, unless
// they are preceded with a mouse down event
static int ignore_drag_release = TRUE;
VTermState *state;
VTermMouseState mouse_state;
vterm_state_get_mousestate(vterm_obtain_state(vterm), &mouse_state);
state = vterm_obtain_state(vterm);
if (state == NULL)
{
return FALSE;
}
vterm_state_get_mousestate(state, &mouse_state);
if (mouse_state.flags == 0)
{
// Terminal is not using the mouse, use modeless selection.
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2113,
/**/
2112,
/**/