From 22ec68d9372b9949ad05797cbda8e4a3c7f8fceb Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 30 May 2008 16:01:07 +0000 Subject: - bbs: check 'badpost' post restriction only if assess is enabled. - bbs: prevent del_post demand incorrect money (if money > MAX_POST_MONEY) - chicken: fix compile error git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4331 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 6 +++++- mbbsd/chicken.c | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index c072c3bc..c3081637 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -387,8 +387,11 @@ int CheckPostRestriction(int bid) return 0; if (cuser.numposts / 10 < (unsigned int)bp->post_limit_posts) return 0; + +#ifdef ASSESS if (cuser.badpost > (255 - (unsigned int)bp->post_limit_badpost)) return 0; +#endif return 1; } @@ -3317,7 +3320,8 @@ del_post(int ent, fileheader_t * fhdr, char *direct) 0) fhdr->multi.money = 0; - if (fhdr->multi.money <= 0) + // XXX also check MAX_POST_MONEY in case any error results in bad money... + if (fhdr->multi.money <= 0 || fhdr->multi.money > MAX_POST_MONEY) { // no need to change user record } diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index bacddcf9..a409ce90 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -453,7 +453,8 @@ ch_hit(chicken_t *mychicken) pressanykey(); } -static void +//static +void ch_buyitem(int money, const char *picture, int *item, int haveticket) { int num = 0; -- cgit v1.2.3