From 67c31724273a5582eaedef7990a68657a36227ad Mon Sep 17 00:00:00 2001 From: David Levine Date: Sat, 29 Oct 2016 22:12:37 -0400 Subject: [PATCH] Set first character of name[] buffer in BODY state. Fix to 47313b9bc395470311e383b57eb184c830662c4a to prevent uninitialized read, revealed by test/burst/test-burst-mime with NMH_VALGRIND=1. --- sbr/m_getfld.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index c99f9e9d..5c5b4a3a 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -661,6 +661,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, */ char *bp; + name[0] = '\0'; max = *bufsz-1; /* Back up and store the current position. */ bp = --s->readpos; -- 2.56.0