diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-10-20 16:03:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-10-20 16:03:33 +0100 |
commit | d0fab10ed2a86698937e3c3fed2f10bd9bb5e731 (patch) | |
tree | 0e8f7a829236eea0654dfb8c1e4de131a05a3fa9 /src/quickfix.c | |
parent | cdef1cefa2a440911c727558562f83ed9b00e16b (diff) | |
download | vim-git-9.0.0805.tar.gz |
patch 9.0.0805: filetype autocmd may cause freed memory accessv9.0.0805
Problem: Filetype autocmd may cause freed memory access.
Solution: Set the quickfix-busy flag while filling the buffer.
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index a90611475..f85fff56f 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -4595,6 +4595,9 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) qf_winid = win->w_id; } + // autocommands may cause trouble + incr_quickfix_busy(); + if (old_last == NULL) // set curwin/curbuf to buf and save a few things aucmd_prepbuf(&aco, buf); @@ -4616,6 +4619,9 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) // when the added lines are not visible. if ((win = qf_find_win(qi)) != NULL && old_line_count < win->w_botline) redraw_buf_later(buf, UPD_NOT_VALID); + + // always called after incr_quickfix_busy() + decr_quickfix_busy(); } } |