diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-23 11:52:06 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-23 11:52:06 +0800 |
commit | 9ad97ad4b96e2a975f196d19cd43af34cd8beaca (patch) | |
tree | 8d89022be11e10f6e5218ef0b13a665de605b40a /mbbsd/cache.c | |
parent | 7dfb1cd0396127830a9ba1011f0febf702e61e75 (diff) | |
download | pttbbs-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/cache.c')
-rw-r--r-- | mbbsd/cache.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 79197183..b76d69da 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -673,18 +673,18 @@ void setbottomtotal(int bid) { boardheader_t *bh = getbcache(bid); - char genbuf[256]; + char fname[PATHLEN]; int n; if(!bh->brdname[0]) return; - setbfile(genbuf, bh->brdname, ".DIR.bottom"); - n = get_num_records(genbuf, sizeof(fileheader_t)); + setbfile(fname, bh->brdname, ".DIR.bottom"); + n = get_num_records(fname, sizeof(fileheader_t)); if(n>5) { #ifdef DEBUG_BOTTOM - log_file("fix_bottom", LOG_CREAT | LOG_VF, "%s n:%d\n", genbuf, n); + log_file("fix_bottom", LOG_CREAT | LOG_VF, "%s n:%d\n", fname, n); #endif - unlink(genbuf); + unlink(fname); SHM->n_bottom[bid-1]=0; } else |