summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-30 13:53:24 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-30 13:53:24 +0800
commit411661c4660d61b365224c5263e5ae93ef04c194 (patch)
tree986602046f5b3e92112274abddadbc61bb8559c9
parentc5484be541d5c1e1929b5dce01cd757fb65d5974 (diff)
downloadpttbbs-411661c4660d61b365224c5263e5ae93ef04c194.tar
pttbbs-411661c4660d61b365224c5263e5ae93ef04c194.tar.gz
pttbbs-411661c4660d61b365224c5263e5ae93ef04c194.tar.bz2
pttbbs-411661c4660d61b365224c5263e5ae93ef04c194.tar.lz
pttbbs-411661c4660d61b365224c5263e5ae93ef04c194.tar.xz
pttbbs-411661c4660d61b365224c5263e5ae93ef04c194.tar.zst
pttbbs-411661c4660d61b365224c5263e5ae93ef04c194.zip
- more check for TagNum
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3764 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/announce.c8
-rw-r--r--mbbsd/read.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index 4b2382c1..3d293fb0 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -631,8 +631,12 @@ a_pastetagpost(menu_t * pm, int mode)
tagnum = TagNum;
// prevent if anything wrong
- if (tagnum >= MAXTAGS)
- tagnum = MAXTAGS;
+ if (tagnum >= MAXTAGS || tagnum < 0)
+ {
+ vmsg("內部錯誤。請把你剛剛進行的完整步驟貼到 "
+ GLOBAL_BUGREPORT " 板。");
+ return ans;
+ }
if (tagnum < 1)
return ans;
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 1335e812..d353b12a 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -57,7 +57,7 @@ Tagger(time4_t chrono, int recno, int mode)
}
if (!comp) {
- if (mode != TAG_TOGGLE)
+ if (mode != TAG_TOGGLE || TagNum <= 0)
return NA;
TagNum--;