mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3396: when libcall() fails invalid pointer may be used
Problem: When libcall() fails invalid pointer may be used. Solution: Initialize the string to NULL. (Yasuhiro Matsumoto, closes #8829)
This commit is contained in:
parent
26a4484da2
commit
87e1587b8a
@ -6689,9 +6689,14 @@ libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type)
|
|||||||
if (argvars[2].v_type == VAR_STRING)
|
if (argvars[2].v_type == VAR_STRING)
|
||||||
string_in = argvars[2].vval.v_string;
|
string_in = argvars[2].vval.v_string;
|
||||||
if (type == VAR_NUMBER)
|
if (type == VAR_NUMBER)
|
||||||
|
{
|
||||||
string_result = NULL;
|
string_result = NULL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
rettv->vval.v_string = NULL;
|
||||||
string_result = &rettv->vval.v_string;
|
string_result = &rettv->vval.v_string;
|
||||||
|
}
|
||||||
if (mch_libcall(argvars[0].vval.v_string,
|
if (mch_libcall(argvars[0].vval.v_string,
|
||||||
argvars[1].vval.v_string,
|
argvars[1].vval.v_string,
|
||||||
string_in,
|
string_in,
|
||||||
|
@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3396,
|
||||||
/**/
|
/**/
|
||||||
3395,
|
3395,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user