mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1896: valgrind warns for using uninitialized memory
Problem: Valgrind warns for using uninitialized memory. Solution: NUL terminate the SmcOpenConnection() error message. (Dominique Pellé, closes #7194)
This commit is contained in:
@@ -8068,10 +8068,13 @@ xsmp_init(void)
|
||||
errorstring);
|
||||
if (xsmp.smcconn == NULL)
|
||||
{
|
||||
char errorreport[132];
|
||||
|
||||
if (p_verbose > 0)
|
||||
{
|
||||
char errorreport[132];
|
||||
|
||||
// If the message is too long it might not be NUL terminated. Add
|
||||
// a NUL at the end to make sure we don't go over the end.
|
||||
errorstring[sizeof(errorstring) - 1] = NUL;
|
||||
vim_snprintf(errorreport, sizeof(errorreport),
|
||||
_("XSMP SmcOpenConnection failed: %s"), errorstring);
|
||||
verb_msg(errorreport);
|
||||
|
Reference in New Issue
Block a user