mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
patch 9.2.0213: Crash when using a partial or lambda as a clipboard provider
Problem: Crash when using a partial or lambda as a clipboard provider
Solution: Don't call free_callback() from clip_provider_get_callback()
(Shane Harper).
closes: #19766
Signed-off-by: Shane Harper <shane@shaneharper.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
3ee2b76ba1
commit
b1a247d659
+2
-1
@@ -3778,7 +3778,8 @@ clip_provider_get_callback(
|
||||
|
||||
// func_tv owns the function name, so we must make a copy for the callback
|
||||
set_callback(callback, &cb);
|
||||
free_callback(&cb);
|
||||
if (cb.cb_free_name)
|
||||
vim_free(cb.cb_name);
|
||||
clear_tv(&func_tv);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -866,10 +866,14 @@ endfunc
|
||||
func Test_clipboard_provider_copy()
|
||||
CheckFeature clipboard_provider
|
||||
|
||||
function s:copy_cb_to_test_partial(_, reg, type, str)
|
||||
call s:Copy(a:reg, a:type, a:str)
|
||||
endfunction
|
||||
|
||||
let v:clipproviders["test"] = {
|
||||
\ "copy": {
|
||||
\ '+': function("s:Copy"),
|
||||
\ '*': function("s:Copy")
|
||||
\ '*': function("s:copy_cb_to_test_partial", [""])
|
||||
\ }
|
||||
\ }
|
||||
set clipmethod=test
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
213,
|
||||
/**/
|
||||
212,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user