• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionfa0aac214da6b06d5e9370b633af1a08b446f1c2 (tree)
Time2020-10-24 20:45:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.1896: valgrind warns for using uninitialized memory

Commit: https://github.com/vim/vim/commit/e1be11864d1f4383171e3af3eb77e61d41140c4e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 24 13:30:51 2020 +0200

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)

Change Summary

Incremental Difference

diff -r fe872013002c -r fa0aac214da6 src/os_unix.c
--- a/src/os_unix.c Fri Oct 23 19:00:04 2020 +0200
+++ b/src/os_unix.c Sat Oct 24 13:45:04 2020 +0200
@@ -8068,10 +8068,13 @@
80688068 errorstring);
80698069 if (xsmp.smcconn == NULL)
80708070 {
8071- char errorreport[132];
8072-
80738071 if (p_verbose > 0)
80748072 {
8073+ char errorreport[132];
8074+
8075+ // If the message is too long it might not be NUL terminated. Add
8076+ // a NUL at the end to make sure we don't go over the end.
8077+ errorstring[sizeof(errorstring) - 1] = NUL;
80758078 vim_snprintf(errorreport, sizeof(errorreport),
80768079 _("XSMP SmcOpenConnection failed: %s"), errorstring);
80778080 verb_msg(errorreport);
diff -r fe872013002c -r fa0aac214da6 src/version.c
--- a/src/version.c Fri Oct 23 19:00:04 2020 +0200
+++ b/src/version.c Sat Oct 24 13:45:04 2020 +0200
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 1896,
755+/**/
754756 1895,
755757 /**/
756758 1894,
Show on old repository browser