Mercurial > vim
diff src/userfunc.c @ 27482:14640c6fe1fe v8.2.4269
patch 8.2.4269: Coverity warns for using a NULL pointer
Commit: https://github.com/vim/vim/commit/48a604845e33399893d6bf293e71bcd2a412800d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 31 11:44:48 2022 +0000
patch 8.2.4269: Coverity warns for using a NULL pointer
Problem: Coverity warns for using a NULL pointer.
Solution: Check for "name" to not be NULL.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 31 Jan 2022 12:45:05 +0100 |
parents | 4f1cf9579e4e |
children | a54064e14114 |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -4232,7 +4232,8 @@ define_function(exarg_T *eap, char_u *na name = prefixed; } } - else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL) + else if (vim9script && name != NULL + && vim_strchr(name, AUTOLOAD_CHAR) != NULL) { emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead)); goto ret_free;