Mercurial > vim
comparison src/gui.c @ 33482:39b2e200c4d7 v9.0.1992
patch 9.0.1992: [security] segfault in exmode
Commit: https://github.com/vim/vim/commit/20d161ace307e28690229b68584f2d84556f8960
Author: Christian Brabandt <cb@256bit.org>
Date: Thu Oct 5 22:08:30 2023 +0200
patch 9.0.1992: [security] segfault in exmode
Problem: segfault in exmode when redrawing
Solution: skip gui_scroll when exmode_active
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 05 Oct 2023 22:15:03 +0200 |
parents | 695b50472e85 |
children | 1629cc65d78d |
comparison
equal
deleted
inserted
replaced
33481:a98b4a9f8864 | 33482:39b2e200c4d7 |
---|---|
4395 | 4395 |
4396 /* | 4396 /* |
4397 * Scroll a window according to the values set in the globals | 4397 * Scroll a window according to the values set in the globals |
4398 * "current_scrollbar" and "scrollbar_value". | 4398 * "current_scrollbar" and "scrollbar_value". |
4399 * Return TRUE if the cursor in the current window moved or FALSE otherwise. | 4399 * Return TRUE if the cursor in the current window moved or FALSE otherwise. |
4400 * may eventually cause a redraw using updateWindow | |
4400 */ | 4401 */ |
4401 int | 4402 int |
4402 gui_do_scroll(void) | 4403 gui_do_scroll(void) |
4403 { | 4404 { |
4404 win_T *wp, *save_wp; | 4405 win_T *wp, *save_wp; |
4413 for (wp = firstwin, i = 0; i < current_scrollbar; wp = W_NEXT(wp), i++) | 4414 for (wp = firstwin, i = 0; i < current_scrollbar; wp = W_NEXT(wp), i++) |
4414 if (wp == NULL) | 4415 if (wp == NULL) |
4415 break; | 4416 break; |
4416 if (wp == NULL) | 4417 if (wp == NULL) |
4417 // Couldn't find window | 4418 // Couldn't find window |
4419 return FALSE; | |
4420 // don't redraw, LineOffset and similar are not valid! | |
4421 if (exmode_active) | |
4418 return FALSE; | 4422 return FALSE; |
4419 | 4423 |
4420 /* | 4424 /* |
4421 * Compute number of lines to scroll. If zero, nothing to do. | 4425 * Compute number of lines to scroll. If zero, nothing to do. |
4422 */ | 4426 */ |