]> granicus.if.org Git - vim/commitdiff
patch 7.4.2349 v7.4.2349
authorBram Moolenaar <Bram@vim.org>
Fri, 9 Sep 2016 12:17:18 +0000 (14:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 9 Sep 2016 12:17:18 +0000 (14:17 +0200)
Problem:    Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.

src/message.c
src/version.c

index 6ec325eb4eec97b55692ab290aaf7c00ad454089..f8152a7b50df8597103af1f2195e661d855e90df 100644 (file)
@@ -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))
        {
index b2b9334e8cc31ecd5a7b5e336198eab063dfec15..194a51a7e7a39a3f37902206d6a46bbcf01eb01f 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2349,
 /**/
     2348,
 /**/