Skip to content

Commit 87e1587

Browse files
committed
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)
1 parent 26a4484 commit 87e1587

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/evalfunc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6689,9 +6689,14 @@ libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type)
66896689
if (argvars[2].v_type == VAR_STRING)
66906690
string_in = argvars[2].vval.v_string;
66916691
if (type == VAR_NUMBER)
6692+
{
66926693
string_result = NULL;
6694+
}
66936695
else
6696+
{
6697+
rettv->vval.v_string = NULL;
66946698
string_result = &rettv->vval.v_string;
6699+
}
66956700
if (mch_libcall(argvars[0].vval.v_string,
66966701
argvars[1].vval.v_string,
66976702
string_in,

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3396,
758760
/**/
759761
3395,
760762
/**/

0 commit comments

Comments
 (0)