# HG changeset patch # User Christian Brabandt # Date 1473424208 -7200 # Node ID dd0531938cb6b566886cf89ddc225b446d8f39e1 # Parent dc0ef5ba2d243966db6649e39381881761bd7573 commit https://github.com/vim/vim/commit/2321ca2a78286bc026fa7f407281ddbeb04114bb Author: Bram Moolenaar Date: Fri Sep 9 14:17:18 2016 +0200 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 --- 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 --- 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,