mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/133858: Out-of-bounds access
Allocating insufficient memory for the terminating NUL of the string. False positive, we allocating more memory than we need.
This commit is contained in:
parent
7a8e41e8ee
commit
f2558890f5
@ -1661,6 +1661,8 @@ static void cs_print_tags_priv(char **matches, char **cntxts,
|
||||
// NUL terminate tag string in matches[0].
|
||||
*ptag_end = NUL;
|
||||
|
||||
// The "%s" in cstag_msg won't appear in the result string, so we don't need
|
||||
// extra memory for terminating NUL.
|
||||
size_t newsize = strlen(cstag_msg) + (size_t)(ptag_end - ptag);
|
||||
char *buf = xmalloc(newsize);
|
||||
size_t bufsize = newsize; // Track available bufsize
|
||||
|
Loading…
Reference in New Issue
Block a user