comparison src/quickfix.c @ 33150:cdc797578b8b v9.0.1857

patch 9.0.1857: [security] heap-use-after-free in is_qf_win() Commit: https://github.com/vim/vim/commit/fc68299d436cf87453e432daa77b6d545df4d7ed Author: Christian Brabandt <cb@256bit.org> Date: Sun Sep 3 20:20:52 2023 +0200 patch 9.0.1857: [security] heap-use-after-free in is_qf_win() Problem: heap-use-after-free in is_qf_win() Solution: Check buffer is valid before accessing it Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Sep 2023 20:30:02 +0200
parents 29b2193466e0
children 5614c43616fe
comparison
equal deleted inserted replaced
33149:f566f2aae66b 33150:cdc797578b8b
4490 { 4490 {
4491 // A window displaying the quickfix buffer will have the w_llist_ref field 4491 // A window displaying the quickfix buffer will have the w_llist_ref field
4492 // set to NULL. 4492 // set to NULL.
4493 // A window displaying a location list buffer will have the w_llist_ref 4493 // A window displaying a location list buffer will have the w_llist_ref
4494 // pointing to the location list. 4494 // pointing to the location list.
4495 if (bt_quickfix(win->w_buffer)) 4495 if (buf_valid(win->w_buffer) && bt_quickfix(win->w_buffer))
4496 if ((IS_QF_STACK(qi) && win->w_llist_ref == NULL) 4496 if ((IS_QF_STACK(qi) && win->w_llist_ref == NULL)
4497 || (IS_LL_STACK(qi) && win->w_llist_ref == qi)) 4497 || (IS_LL_STACK(qi) && win->w_llist_ref == qi))
4498 return TRUE; 4498 return TRUE;
4499 4499
4500 return FALSE; 4500 return FALSE;