]> granicus.if.org Git - vim/commitdiff
patch 8.2.4417: using NULL pointer v8.2.4417
authorBram Moolenaar <Bram@vim.org>
Fri, 18 Feb 2022 18:34:45 +0000 (18:34 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 18 Feb 2022 18:34:45 +0000 (18:34 +0000)
Problem:    Using NULL pointer.
Solution:   Set offset after checking for NULL pointer.

src/userfunc.c
src/version.c

index 696320c3e91dc5e6c743546b1dc2ffc2886cf663..3e0d021ba8933022e37ff521eaf0fb9b70666ca2 100644 (file)
@@ -4024,7 +4024,7 @@ untrans_function_name(char_u *name)
 get_scriptlocal_funcname(char_u *funcname)
 {
     char       sid_buf[25];
-    int                off = *funcname == 's' ? 2 : 5;
+    int                off;
     char_u     *newname;
     char_u     *p = funcname;
 
@@ -4047,6 +4047,8 @@ get_scriptlocal_funcname(char_u *funcname)
        ++p;
        off = 0;
     }
+    else
+       off = *funcname == 's' ? 2 : 5;
 
     if (!SCRIPT_ID_VALID(current_sctx.sc_sid))
     {
index c9968125b8cdd7840db59ed4b073ed71f2aab987..f95b395b7a2eabe0cef0c71f65a367b01e28ac97 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4417,
 /**/
     4416,
 /**/