summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-09 14:17:18 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-09 14:17:18 +0200
commit2321ca2a78286bc026fa7f407281ddbeb04114bb (patch)
tree005460893dee4e745b78b90300b66afaa0395682
parent9a27c7fde6d453d9892b6f6baa756bce4d6d419d (diff)
patch 7.4.2349v7.4.2349
Problem: Valgrind reports using uninitialzed memory. (Dominique Pelle) Solution: Check the length before checking for a NUL.
-rw-r--r--src/message.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/message.c b/src/message.c
index 6ec325eb4e..f8152a7b50 100644
--- a/src/message.c
+++ b/src/message.c
@@ -2462,7 +2462,7 @@ msg_puts_printf(char_u *str, int maxlen)
if (!(silent_mode && p_verbose == 0))
mch_settmode(TMODE_COOK); /* handle '\r' and '\n' correctly */
#endif
- while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
+ while ((maxlen < 0 || (int)(s - str) < maxlen) && *s != NUL)
{
if (!(silent_mode && p_verbose == 0))
{
diff --git a/src/version.c b/src/version.c
index b2b9334e8c..194a51a7e7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2349,
+/**/
2348,
/**/
2347,