diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 11:06:49 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 11:47:59 +0800 |
commit | 5740b3e076770336a15e88263878546345a3d325 (patch) | |
tree | 76575664da0b3f37bb2f9bbb2678c0f12cbb3b65 /src/nvim/quickfix.c | |
parent | 186c489fd6b1073feefef0e2c3774d908bd06615 (diff) | |
download | rneovim-5740b3e076770336a15e88263878546345a3d325.tar.gz rneovim-5740b3e076770336a15e88263878546345a3d325.tar.bz2 rneovim-5740b3e076770336a15e88263878546345a3d325.zip |
vim-patch:9.0.0260: using freed memory when using 'quickfixtextfunc' recursively
Problem: Using freed memory when using 'quickfixtextfunc' recursively.
Solution: Do not allow for recursion.
https://github.com/vim/vim/commit/d6c67629ed05aae436164eec474832daf8ba7420
Cherry-pick Test_qflist_statusmsg() from patch 8.2.4617.
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index d364cebc9d..d680ab8cf3 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3984,6 +3984,12 @@ static list_T *call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long { Callback *cb = &qftf_cb; list_T *qftf_list = NULL; + static bool recursive = false; + + if (recursive) { + return NULL; // this doesn't work properly recursively + } + recursive = true; // If 'quickfixtextfunc' is set, then use the user-supplied function to get // the text to display. Use the local value of 'quickfixtextfunc' if it is @@ -4017,6 +4023,7 @@ static list_T *call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long tv_dict_unref(dict); } + recursive = false; return qftf_list; } |