From: David Levine Date: Sun, 30 Oct 2016 02:12:37 +0000 (-0400) Subject: Set first character of name[] buffer in BODY state. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/67c31724273a5582eaedef7990a68657a36227ad?hp=0969599eba5841ed5c2393195b524139ecc89cd5 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. --- 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;