mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0883: invalid memory access with nonsensical script
Problem: Invalid memory access with nonsensical script.
Solution: Check "dstlen" being positive. (Dominique Pelle)
1c864093f9
This commit is contained in:
parent
c0157e8fe0
commit
cba3025c43
@ -457,12 +457,15 @@ void expand_env_esc(char_u *restrict srcp,
|
|||||||
} else if ((src[0] == ' ' || src[0] == ',') && !one) {
|
} else if ((src[0] == ' ' || src[0] == ',') && !one) {
|
||||||
at_start = true;
|
at_start = true;
|
||||||
}
|
}
|
||||||
*dst++ = *src++;
|
if (dstlen > 0) {
|
||||||
--dstlen;
|
*dst++ = *src++;
|
||||||
|
dstlen--;
|
||||||
|
|
||||||
if (prefix != NULL && src - prefix_len >= srcp
|
if (prefix != NULL
|
||||||
&& STRNCMP(src - prefix_len, prefix, prefix_len) == 0) {
|
&& src - prefix_len >= srcp
|
||||||
at_start = true;
|
&& STRNCMP(src - prefix_len, prefix, prefix_len) == 0) {
|
||||||
|
at_start = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user