diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-16 17:50:38 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-16 17:50:38 +0100 |
commit | f6d39c31d2177549a986d170e192d8351bd571e2 (patch) | |
tree | 88571362c680104807bb5201a8e1f52871b8de39 /src/globals.h | |
parent | 948a3894d98f5e2a6e7fc57189fe9c2a5919eebf (diff) | |
download | vim-git-f6d39c31d2177549a986d170e192d8351bd571e2.tar.gz |
patch 9.0.0220: invalid memory access with for loop over NULL stringv9.0.0220
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL.
Diffstat (limited to 'src/globals.h')
-rw-r--r-- | src/globals.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/globals.h b/src/globals.h index 1fadc744f..21fabdbb5 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1035,7 +1035,8 @@ EXTERN vimconv_T output_conv; // type of output conversion * (DBCS). * The value is set in mb_init(); */ -// length of char in bytes, including following composing chars +// Length of char in bytes, including any following composing chars. +// NUL has length zero. EXTERN int (*mb_ptr2len)(char_u *p) INIT(= latin_ptr2len); // idem, with limit on string length |