Skip to content

Commit 2321ca2

Browse files
committed
patch 7.4.2349
Problem: Valgrind reports using uninitialzed memory. (Dominique Pelle) Solution: Check the length before checking for a NUL.
1 parent 9a27c7f commit 2321ca2

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/message.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ msg_puts_printf(char_u *str, int maxlen)
24622462
if (!(silent_mode && p_verbose == 0))
24632463
mch_settmode(TMODE_COOK); /* handle '\r' and '\n' correctly */
24642464
#endif
2465-
while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
2465+
while ((maxlen < 0 || (int)(s - str) < maxlen) && *s != NUL)
24662466
{
24672467
if (!(silent_mode && p_verbose == 0))
24682468
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2349,
766768
/**/
767769
2348,
768770
/**/

0 commit comments

Comments
 (0)