1
0
forked from aniani/vim

patch 7.4.2349

Problem:    Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.
This commit is contained in:
Bram Moolenaar
2016-09-09 14:17:18 +02:00
parent 9a27c7fde6
commit 2321ca2a78
2 changed files with 3 additions and 1 deletions

View 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))
{