From: Philipp Takacs Date: Sat, 27 Feb 2016 14:45:26 +0000 (+0100) Subject: check return value of m_getfld2 befor using the field X-Git-Tag: mmh-0.3~39^2~1 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=1646b692af15ca4aac6d2c77fa72f63a18515215;ds=sidebyside check return value of m_getfld2 befor using the field this bug causes a segfault, because the field.value is a nullptr if FILEEOF2 is returned. --- diff --git a/uip/distsbr.c b/uip/distsbr.c index 9c20fda..058875c 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -182,10 +182,10 @@ ready_msg(char *msgnam) return NOTOK; } unlink(tmpfil); - fprintf(ofp, "\n%s", f.value); + fputs("\n", ofp); while (state == BODY2) { - state = m_getfld2(state, &f, ifp); fputs(f.value, ofp); + state = m_getfld2(state, &f, ifp); } /* FALL */