Headline
CVE-2022-2522: patch 9.0.0061: ml_get error with nested autocommand · vim/vim@5fa9f23
Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0060.
@@ -6770,34 +6770,55 @@ only_one_window(void)
}
/*
* Correct the cursor line number in other windows. Used after changing the
* current buffer, and before applying autocommands.
* When “do_curwin” is TRUE, also check current window.
* Implementation of check_lnums() and check_lnums_nested().
*/
void
check_lnums(int do_curwin)
static void
check_lnums_both(int do_curwin, int nested)
{
win_T *wp;
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, wp)
if ((do_curwin || wp != curwin) && wp->w_buffer == curbuf)
{
// save the original cursor position and topline
wp->w_save_cursor.w_cursor_save = wp->w_cursor;
wp->w_save_cursor.w_topline_save = wp->w_topline;
if (!nested)
{
// save the original cursor position and topline
wp->w_save_cursor.w_cursor_save = wp->w_cursor;
wp->w_save_cursor.w_topline_save = wp->w_topline;
}
if (wp->w_cursor.lnum > curbuf->b_ml.ml_line_count)
wp->w_cursor.lnum = curbuf->b_ml.ml_line_count;
if (wp->w_topline > curbuf->b_ml.ml_line_count)
wp->w_topline = curbuf->b_ml.ml_line_count;
// save the corrected cursor position and topline
// save the (corrected) cursor position and topline
wp->w_save_cursor.w_cursor_corr = wp->w_cursor;
wp->w_save_cursor.w_topline_corr = wp->w_topline;
}
}
/*
* Correct the cursor line number in other windows. Used after changing the
* current buffer, and before applying autocommands.
* When “do_curwin” is TRUE, also check current window.
*/
void
check_lnums(int do_curwin)
{
check_lnums_both(do_curwin, FALSE);
}
/*
* Like check_lnums() but for when check_lnums() was already called.
*/
void
check_lnums_nested(int do_curwin)
{
check_lnums_both(do_curwin, TRUE);
}
/*
* Reset cursor and topline to its stored values from check_lnums().
* check_lnums() must have been called first!
Related news
Ubuntu Security Notice 6302-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 possibly execute arbitrary code. This issue only affected Ubuntu 22.04 LTS. It was discovered that Vim did not properly perform bounds checks in the diff mode in certain situations. An attacker could possibly use this issue to cause a denial of service. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS.
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.
Dell VxRail, versions prior to 7.0.410, contain a Container Escape Vulnerability. A local high-privileged attacker could potentially exploit this vulnerability, leading to the execution of arbitrary OS commands on the container's underlying OS. Exploitation may lead to a system take over by an attacker.
Hello everyone! Great news for my open source Scanvus project! You can now perform vulnerability checks on Linux hosts and docker images not only using the Vulners.com API, but also with the Vulns.io VM API. It’s especially nice that all the code to support the new API was written and contributed by colleagues from Vulns.io. […]