From: Bram Moolenaar Date: Fri, 9 Sep 2016 12:17:18 +0000 (+0200) Subject: patch 7.4.2349 X-Git-Tag: v7.4.2349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2321ca2a78286bc026fa7f407281ddbeb04114bb;p=vim patch 7.4.2349 Problem: Valgrind reports using uninitialzed memory. (Dominique Pelle) Solution: Check the length before checking for a NUL. --- diff --git a/src/message.c b/src/message.c index 6ec325eb4..f8152a7b5 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 b2b9334e8..194a51a7e 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2349, /**/ 2348, /**/