mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 03:58:32 +00:00
vim-patch:8.2.2515: memory access error when truncating an empty message
Problem: Memory access error when truncating an empty message.
Solution: Check for an empty string. (Dominique Pellé, closes vim/vim#7841)
6281815ecc
This commit is contained in:
@@ -382,6 +382,13 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen)
|
|||||||
int i;
|
int i;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
if (*s == NUL) {
|
||||||
|
if (buflen > 0) {
|
||||||
|
*buf = NUL;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (room_in < 3) {
|
if (room_in < 3) {
|
||||||
room = 0;
|
room = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user