summaryrefslogtreecommitdiffstats
path: root/mbbsd/record.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-23 11:52:06 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-23 11:52:06 +0800
commit9ad97ad4b96e2a975f196d19cd43af34cd8beaca (patch)
tree8d89022be11e10f6e5218ef0b13a665de605b40a /mbbsd/record.c
parent7dfb1cd0396127830a9ba1011f0febf702e61e75 (diff)
downloadpttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.tar
pttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.tar.gz
pttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.tar.bz2
pttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.tar.lz
pttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.tar.xz
pttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.tar.zst
pttbbs-9ad97ad4b96e2a975f196d19cd43af34cd8beaca.zip
set*() family functions all assume buffer size = PATHLEN, to prevent buffer overflow.
do some s/256/PATHLEN/. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3074 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/record.c')
-rw-r--r--mbbsd/record.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mbbsd/record.c b/mbbsd/record.c
index f244876a..0a4e9255 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -135,22 +135,22 @@ int
substitute_ref_record(const char *direct, fileheader_t * fhdr, int ent)
{
fileheader_t hdr;
- char genbuf[256];
+ char fname[PATHLEN];
int num = 0;
/* rocker.011018: 串接模式用reference增進效率 */
if (!(fhdr->filemode & FILE_BOTTOM) && (fhdr->multi.refer.flag) &&
(num = fhdr->multi.refer.ref)){
- setdirpath(genbuf, direct, ".DIR");
- get_record(genbuf, &hdr, sizeof(hdr), num);
+ setdirpath(fname, direct, ".DIR");
+ get_record(fname, &hdr, sizeof(hdr), num);
if (strcmp(hdr.filename, fhdr->filename)) {
- if((num = getindex(genbuf, fhdr, num))>0) {
- substitute_record(genbuf, fhdr, sizeof(*fhdr), num);
+ if((num = getindex(fname, fhdr, num))>0) {
+ substitute_record(fname, fhdr, sizeof(*fhdr), num);
}
}
else if(num>0) {
fhdr->multi.money = hdr.multi.money;
- substitute_record(genbuf, fhdr, sizeof(*fhdr), num);
+ substitute_record(fname, fhdr, sizeof(*fhdr), num);
}
fhdr->multi.refer.flag = 1;
fhdr->multi.refer.ref = num; // Ptt: update now!