comparison src/mbyte.c @ 25092:cd5e8df05a64 v8.2.3083

patch 8.2.3083: crash when passing null string to charclass() Commit: https://github.com/vim/vim/commit/72463f883cdfd08e29ab0018ef3889284848d5f1 Author: Christian Brabandt <cb@256bit.org> Date: Fri Jul 2 20:19:31 2021 +0200 patch 8.2.3083: crash when passing null string to charclass() Problem: Crash when passing null string to charclass(). Solution: Bail out when string pointer is NULL. (Christian Brabandt, closes #8498, closes #8260)
author Bram Moolenaar <Bram@vim.org>
date Fri, 02 Jul 2021 20:30:05 +0200
parents 042560a16d4e
children dc66d0284518
comparison
equal deleted inserted replaced
25091:143c87f12b9b 25092:cd5e8df05a64
5585 } 5585 }
5586 5586
5587 void 5587 void
5588 f_charclass(typval_T *argvars, typval_T *rettv UNUSED) 5588 f_charclass(typval_T *argvars, typval_T *rettv UNUSED)
5589 { 5589 {
5590 if (check_for_string_arg(argvars, 0) == FAIL) 5590 if (check_for_string_arg(argvars, 0) == FAIL
5591 || argvars[0].vval.v_string == NULL)
5591 return; 5592 return;
5592 rettv->vval.v_number = mb_get_class(argvars[0].vval.v_string); 5593 rettv->vval.v_number = mb_get_class(argvars[0].vval.v_string);
5593 } 5594 }
5594 #endif 5595 #endif