summaryrefslogtreecommitdiffstats
path: root/mbbsd/mail.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-02-29 11:08:55 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-02-29 11:08:55 +0800
commit8f54d0a4670439d227e46f140c30e227e9840c06 (patch)
treebc34459f80abc5898664a0b1a936a110cffe82fe /mbbsd/mail.c
parent49cf374ce8fcda5a182e8489a43ca9df1a085da5 (diff)
downloadpttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.tar
pttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.tar.gz
pttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.tar.bz2
pttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.tar.lz
pttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.tar.xz
pttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.tar.zst
pttbbs-8f54d0a4670439d227e46f140c30e227e9840c06.zip
- mail: fail-safe filename check to avoid segv crash
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3954 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mail.c')
-rw-r--r--mbbsd/mail.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index a5f09ce3..a7e7504e 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -654,6 +654,9 @@ multi_send(char *title)
static int
multi_reply(int ent, fileheader_t * fhdr, const char *direct)
{
+ if (!fhdr || !fhdr->filename[0])
+ return DONOTHING;
+
if (!(fhdr->filemode & FILE_MULTI))
return mail_reply(ent, fhdr, direct);
@@ -1210,6 +1213,9 @@ mail_reply(int ent, fileheader_t * fhdr, const char *direct)
char genbuf[512];
int oent = ent;
+ if (!fhdr || !fhdr->filename[0])
+ return DONOTHING;
+
stand_title("¦^ «H");
/* §PÂ_¬O boards ©Î mail */