projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c6b463
)
check return value of m_getfld2 befor using the field
author
Philipp Takacs
<philipp@bureaucracy.de>
Sat, 27 Feb 2016 14:45:26 +0000
(15:45 +0100)
committer
Philipp Takacs
<philipp@bureaucracy.de>
Sat, 27 Feb 2016 14:45:26 +0000
(15:45 +0100)
this bug causes a segfault, because the field.value is a
nullptr if FILEEOF2 is returned.
uip/distsbr.c
patch
|
blob
|
history
diff --git
a/uip/distsbr.c
b/uip/distsbr.c
index
9c20fda
..
058875c
100644
(file)
--- 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 */