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/read.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/read.c')
-rw-r--r-- | mbbsd/read.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c index b2cc64a4..5866422e 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.2 2002/04/28 19:35:29 in2 Exp $ */ +/* $Id: read.c,v 1.3 2002/04/29 07:05:45 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <ctype.h> @@ -19,7 +19,7 @@ extern int p_lines; /* a Page of Screen line numbers: tlines-4 */ extern int b_lines; /* Screen bottom line number: t_lines-1 */ extern char currowner[IDLEN + 2]; -extern char currtitle[44]; +extern char currtitle[TTLEN + 1]; extern char currauthor[IDLEN + 2]; extern char *str_reply; extern char *msg_fwd_ok; @@ -385,7 +385,7 @@ static int thread(keeploc_t *locmem, int stype) { tag = headers[pos - locmem->top_ln].title; if(stype & RS_CURRENT) { if(stype & RS_FIRST) { - if(!strncmp(currtitle, tag, 40)) + if(!strncmp(currtitle, tag, TTLEN)) return DONOTHING; near = 0; } @@ -468,8 +468,8 @@ static int thread(keeploc_t *locmem, int stype) { match = cursor_pos(locmem, now, 10); if((!(stype & RS_CURRENT)) && (stype & RS_RELATED) && - strncmp(currtitle, query, 40)) { - strncpy(currtitle, query, 40); + strncmp(currtitle, query, TTLEN)) { + strncpy(currtitle, query, TTLEN); match = PARTUPDATE; } break; |