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/announce.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/announce.c')
-rw-r--r-- | mbbsd/announce.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c index b549a252..72a5fe8c 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -721,7 +721,7 @@ a_moveitem(menu_t * pm) static void a_delrange(menu_t * pm) { - char fname[256]; + char fname[PATHLEN]; snprintf(fname, sizeof(fname), "%s/.DIR", pm->path); del_range(0, NULL, fname); @@ -1338,7 +1338,7 @@ void BlogMain(int num) MYSQL mysql; char cmd[256]; - sprintf(cmd, "delete from comment where " + snprintf(cmd, sizeof(cmd), "delete from comment where " "hash='%s'&&brdname='%s'", hash, currboard); #ifdef DEBUG vmsg(cmd); |