1
0
forked from aniani/vim

patch 9.0.1873: [security] heap-buffer-overflow in vim_regsub_both

Problem:  heap-buffer-overflow in vim_regsub_both
Solution: Disallow exchanging windows when textlock is active

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2023-09-05 20:18:06 +02:00
parent d2a08ba0fa
commit f6d28fe2c9
5 changed files with 19 additions and 0 deletions

View File

@@ -4519,6 +4519,9 @@ ex_substitute(exarg_T *eap)
{
nmatch = curbuf->b_ml.ml_line_count - sub_firstlnum + 1;
skip_match = TRUE;
// safety check
if (nmatch < 0)
goto skip;
}
// Need room for: