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>
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.
// 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.
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2113,
/**/
2112,
/**/