From 1646b692af15ca4aac6d2c77fa72f63a18515215 Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Sat, 27 Feb 2016 15:45:26 +0100 Subject: [PATCH] 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. --- uip/distsbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 */ -- 1.7.10.4