From f9a31e98505c0f5e83dd3ba957fbd0f4b150d30c Mon Sep 17 00:00:00 2001 From: lonerover Date: Mon, 27 Mar 2017 01:04:57 +0800 Subject: vim-patch:7.4.2349 (#6368) Problem: Valgrind reports using uninitialzed memory. (Dominique Pelle) Solution: Check the length before checking for a NUL. https://github.com/vim/vim/commit/2321ca2a78286bc026fa7f407281ddbeb04114bb --- src/nvim/message.c | 2 +- src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index cc9ef15f13..bf54284881 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1986,7 +1986,7 @@ static void msg_puts_printf(const char *str, const ptrdiff_t maxlen) char buf[4]; char *p; - while (*s != NUL && (maxlen < 0 || s - str < maxlen)) { + while ((maxlen < 0 || s - str < maxlen) && *s != NUL) { if (!(silent_mode && p_verbose == 0)) { // NL --> CR NL translation (for Unix, not for "--version") p = &buf[0]; diff --git a/src/nvim/version.c b/src/nvim/version.c index db3b9b51b2..a354634218 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -92,7 +92,7 @@ static int included_patches[] = { // 2352 NA // 2351 NA // 2350, - // 2349, + 2349, 2348, 2347, 2346, -- cgit