summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-29 15:05:45 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-29 15:05:45 +0800
commit00c4a848e63ee19ca7f36ba6e7ba0102cc086c09 (patch)
tree8c69ebd77b845199df8573a7a7dd153e42d01fee /mbbsd/bbs.c
parentda81316536e0af773dc46e9779d384fcb23e890b (diff)
downloadpttbbs-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/bbs.c')
-rw-r--r--mbbsd/bbs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 28322370..eb252233 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1,4 +1,4 @@
-/* $Id: bbs.c,v 1.2 2002/04/28 19:35:28 in2 Exp $ */
+/* $Id: bbs.c,v 1.3 2002/04/29 07:05:45 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -154,7 +154,7 @@ static void readtitle() {
extern int brc_num;
extern int brc_list[];
-extern char currtitle[];
+extern char currtitle[TTLEN + 1];
extern int Tagger();
@@ -186,7 +186,7 @@ static void readdoent(int num, fileheader_t *ent) {
if(title[47])
strcpy(title + 44, " ¡K"); /* §â¦h¾lªº string ¬å±¼ */
- if(strncmp(currtitle, title, 40))
+ if(strncmp(currtitle, title, TTLEN))
prints("%6d %c %-7s%-13.12s%s %s\n", num, type,
ent->date, ent->owner, mark, title);
else
@@ -838,7 +838,7 @@ static int read_post(int ent, fileheader_t *fhdr, char *direct) {
return DONOTHING;
brc_addlist(fhdr->filename);
- strncpy(currtitle, subject(fhdr->title), 40);
+ strncpy(currtitle, subject(fhdr->title), TTLEN);
strncpy(currowner, subject(fhdr->owner), IDLEN + 2);
switch (more_result) {