vim-patch:7.4.2349 (#6368)

Problem:    Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.

2321ca2a78
This commit is contained in:
lonerover 2017-03-27 01:04:57 +08:00 committed by Justin M. Keyes
parent 43a99f77a8
commit f9a31e9850
2 changed files with 2 additions and 2 deletions

View File

@ -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];

View File

@ -92,7 +92,7 @@ static int included_patches[] = {
// 2352 NA
// 2351 NA
// 2350,
// 2349,
2349,
2348,
2347,
2346,