diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-29 15:05:45 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-29 15:05:45 +0800 |
commit | 00c4a848e63ee19ca7f36ba6e7ba0102cc086c09 (patch) | |
tree | 8c69ebd77b845199df8573a7a7dd153e42d01fee /mbbsd/mail.c | |
parent | da81316536e0af773dc46e9779d384fcb23e890b (diff) | |
download | pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.tar pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.tar.gz pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.tar.bz2 pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.tar.lz pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.tar.xz pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.tar.zst pttbbs-00c4a848e63ee19ca7f36ba6e7ba0102cc086c09.zip |
fix buffer overflow
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@133 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mail.c')
-rw-r--r-- | mbbsd/mail.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index bc6ff7b3..3fa7ae37 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1,4 +1,4 @@ -/* $Id: mail.c,v 1.3 2002/04/28 19:35:29 in2 Exp $ */ +/* $Id: mail.c,v 1.4 2002/04/29 07:05:45 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -28,7 +28,7 @@ extern char *fn_notes; extern char *msg_mailer; extern char *msg_sure_ny; extern char *BBSName; -extern char currtitle[44]; +extern char currtitle[TTLEN + 1]; extern unsigned char currfmode; /* current file mode */ extern char *msg_del_ny; extern char currfile[FNLEN]; @@ -847,7 +847,7 @@ static void maildoent(int num, fileheader_t *ent) { mark = "R:"; } - if(strncmp(currtitle, title, 40)) + if(strncmp(currtitle, title, TTLEN)) prints("%5d %c %-7s%-15.14s%s %.46s\n", num, type, ent->date, ent->owner, mark, title); else @@ -896,7 +896,7 @@ static int mail_read(int ent, fileheader_t *fhdr, char *direct) { clear(); setdirpath(buf, direct, fhdr->filename); - strncpy(currtitle, subject(fhdr->title), 40); + strncpy(currtitle, subject(fhdr->title), TTLEN); done = delete_it = replied = NA; while(!done) { int more_result = more(buf, YEA); |