summaryrefslogtreecommitdiffstats
path: root/mbbsd/friend.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-04-08 22:58:06 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-04-08 22:58:06 +0800
commit4e8a2c25129260c61df345f15715d75c715cb92c (patch)
tree9056598d7d2db1fe74cbe22fcabf047148c00e03 /mbbsd/friend.c
parent55e87717eb4ab1efdcba4d2622c1c98c71f871e3 (diff)
downloadpttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.tar
pttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.tar.gz
pttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.tar.bz2
pttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.tar.lz
pttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.tar.xz
pttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.tar.zst
pttbbs-4e8a2c25129260c61df345f15715d75c715cb92c.zip
add a lot of assertions to ensure bid is in correct range when access via bid.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3341 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/friend.c')
-rw-r--r--mbbsd/friend.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index e3fa11b6..8f62713f 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -454,8 +454,10 @@ friend_edit(int type)
} else if (type == BOARD_WATER) {
boardheader_t *bp = NULL;
currbid = getbnum(currboard);
+ assert(0<=currbid-1 && currbid-1<MAX_BOARD);
bp = getbcache(currbid);
bp->perm_reload = now;
+ assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
// log_usies("SetBoard", bp->brdname);
}