]> diplodocus.org Git - nmh/commitdiff
Set first character of name[] buffer in BODY state.
authorDavid Levine <levinedl@acm.org>
Sun, 30 Oct 2016 02:12:37 +0000 (22:12 -0400)
committerDavid Levine <levinedl@acm.org>
Sun, 30 Oct 2016 02:12:37 +0000 (22:12 -0400)
Fix to 47313b9bc395470311e383b57eb184c830662c4a to prevent
uninitialized read, revealed by test/burst/test-burst-mime
with NMH_VALGRIND=1.

sbr/m_getfld.c

index c99f9e9d1e4fa2975cdb84a9562d136cc87a60c4..5c5b4a3a88274646175e993af895e64593bd5282 100644 (file)
@@ -661,6 +661,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz,
             */
            char *bp;
 
             */
            char *bp;
 
+            name[0] = '\0';
            max = *bufsz-1;
            /* Back up and store the current position. */
            bp = --s->readpos;
            max = *bufsz-1;
            /* Back up and store the current position. */
            bp = --s->readpos;