Permalink
Browse files

patch 7.4.2349

Problem:    Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.
  • Loading branch information...
1 parent 9a27c7f commit 2321ca2a78286bc026fa7f407281ddbeb04114bb @brammool brammool committed Sep 9, 2016
Showing with 3 additions and 1 deletion.
  1. +1 −1 src/message.c
  2. +2 −0 src/version.c
View
@@ -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))
{
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2349,
+/**/
2348,
/**/
2347,

0 comments on commit 2321ca2

Please sign in to comment.