1
0
forked from aniani/vim

patch 8.2.4417: using NULL pointer

Problem:    Using NULL pointer.
Solution:   Set offset after checking for NULL pointer.
This commit is contained in:
Bram Moolenaar 2022-02-18 18:34:45 +00:00
parent 1fca5f3e86
commit e89bfd212b
2 changed files with 5 additions and 1 deletions

View File

@ -4024,7 +4024,7 @@ untrans_function_name(char_u *name)
get_scriptlocal_funcname(char_u *funcname) get_scriptlocal_funcname(char_u *funcname)
{ {
char sid_buf[25]; char sid_buf[25];
int off = *funcname == 's' ? 2 : 5; int off;
char_u *newname; char_u *newname;
char_u *p = funcname; char_u *p = funcname;
@ -4047,6 +4047,8 @@ get_scriptlocal_funcname(char_u *funcname)
++p; ++p;
off = 0; off = 0;
} }
else
off = *funcname == 's' ? 2 : 5;
if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) if (!SCRIPT_ID_VALID(current_sctx.sc_sid))
{ {

View File

@ -750,6 +750,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 */
/**/
4417,
/**/ /**/
4416, 4416,
/**/ /**/