Headline
CVE-2022-2980: patch 9.0.0259: crash with mouse click when not initialized · vim/vim@8052575
NULL Pointer Dereference in GitHub repository vim/vim prior to 9.0.0258.
@@ -471,74 +471,77 @@ do_mouse(
start_visual.lnum = 0;
// Check for clicking in the tab page line. if (mouse_row == 0 && firstwin->w_winrow > 0) if (TabPageIdxs != NULL) // only when initialized { if (is_drag) // Check for clicking in the tab page line. if (mouse_row == 0 && firstwin->w_winrow > 0) { if (in_tab_line) if (is_drag) { c1 = TabPageIdxs[mouse_col]; tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab) ? c1 - 1 : c1); if (in_tab_line) { c1 = TabPageIdxs[mouse_col]; tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab) ? c1 - 1 : c1); } return FALSE; } return FALSE; }
// click in a tab selects that tab page if (is_click // click in a tab selects that tab page if (is_click # ifdef FEAT_CMDWIN && cmdwin_type == 0 && cmdwin_type == 0 # endif && mouse_col < Columns) { in_tab_line = TRUE; c1 = TabPageIdxs[mouse_col]; if (c1 >= 0) && mouse_col < Columns) { if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) { // double click opens new page end_visual_mode_keep_button(); tabpage_new(); tabpage_move(c1 == 0 ? 9999 : c1 - 1); } else in_tab_line = TRUE; c1 = TabPageIdxs[mouse_col]; if (c1 >= 0) { // Go to specified tab page, or next one if not clicking // on a label. goto_tabpage(c1);
// It’s like clicking on the status line of a window. if (curwin != old_curwin) if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) { // double click opens new page end_visual_mode_keep_button(); } } else { tabpage_T *tp; tabpage_new(); tabpage_move(c1 == 0 ? 9999 : c1 - 1); } else { // Go to specified tab page, or next one if not clicking // on a label. goto_tabpage(c1);
// Close the current or specified tab page. if (c1 == -999) tp = curtab; // It’s like clicking on the status line of a window. if (curwin != old_curwin) end_visual_mode_keep_button(); } } else tp = find_tabpage(-c1); if (tp == curtab) { if (first_tabpage->tp_next != NULL) tabpage_close(FALSE); tabpage_T *tp;
// Close the current or specified tab page. if (c1 == -999) tp = curtab; else tp = find_tabpage(-c1); if (tp == curtab) { if (first_tabpage->tp_next != NULL) tabpage_close(FALSE); } else if (tp != NULL) tabpage_close_other(tp, FALSE); } else if (tp != NULL) tabpage_close_other(tp, FALSE); } return TRUE; } else if (is_drag && in_tab_line) { c1 = TabPageIdxs[mouse_col]; tabpage_move(c1 <= 0 ? 9999 : c1 - 1); return FALSE; } return TRUE; } else if (is_drag && in_tab_line) { c1 = TabPageIdxs[mouse_col]; tabpage_move(c1 <= 0 ? 9999 : c1 - 1); return FALSE; }
// When ‘mousemodel’ is “popup” or "popup_setpos", translate mouse events:
Related news
Dell VxRail versions earlier than 7.0.450, contain(s) an OS command injection vulnerability in VxRail Manager. A local authenticated attacker could potentially exploit this vulnerability, leading to the execution of arbitrary OS commands on the application's underlying OS, with the privileges of the vulnerable application. Exploitation may lead to a system take over by an attacker.
Gentoo Linux Security Advisory 202305-16 - Multiple vulnerabilities have been found in Vim, the worst of which could result in denial of service. Versions less than 9.0.1157 are affected.
Ubuntu Security Notice 5995-1 - It was discovered that Vim incorrectly handled memory when opening certain files. If an attacker could trick a user into opening a specially crafted file, it could cause Vim to crash, or possible execute arbitrary code. This issue only affected Ubuntu 14.04 ESM, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, and Ubuntu 22.04 LTS.