diff src/list.c @ 20158:94f05de75e9f v8.2.0634

patch 8.2.0634: crash with null partial and blob Commit: https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 25 15:24:44 2020 +0200 patch 8.2.0634: crash with null partial and blob Problem: Crash with null partial and blob. Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan, closes #5984)
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Apr 2020 15:30:04 +0200
parents aadd1cae2ff5
children 4c317d8c1051
line wrap: on
line diff
--- a/src/list.c
+++ b/src/list.c
@@ -2167,6 +2167,9 @@ f_insert(typval_T *argvars, typval_T *re
 	int	    val, len;
 	char_u	    *p;
 
+	if (argvars[0].vval.v_blob == NULL)
+	    return;
+
 	len = blob_len(argvars[0].vval.v_blob);
 	if (argvars[2].v_type != VAR_UNKNOWN)
 	{