summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-24 20:39:34 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-24 20:39:34 +0800
commitbe3896ab32652fd94ffed46eeca724c95c9f4b76 (patch)
tree5a60c4e3d04e2c1b2042fb0d88493b246d0a3959
parentf7365ebaa63fc23953255b00c518fb62ab270915 (diff)
downloadpttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.tar
pttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.tar.gz
pttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.tar.bz2
pttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.tar.lz
pttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.tar.xz
pttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.tar.zst
pttbbs-be3896ab32652fd94ffed46eeca724c95c9f4b76.zip
- fix: crash when input board name was invalid in voteboard (thanks: LukET@PttBug)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4473 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/voteboard.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pttbbs/mbbsd/voteboard.c b/pttbbs/mbbsd/voteboard.c
index f9af60ff..8badcf0f 100644
--- a/pttbbs/mbbsd/voteboard.c
+++ b/pttbbs/mbbsd/voteboard.c
@@ -273,6 +273,11 @@ do_voteboard(int type)
&completeboard_compar,
&completeboard_permission,
&completeboard_getname);
+ if (!getbnum(topic))
+ {
+ vmsg("無此看版。");
+ return FULLUPDATE;
+ }
snprintf(title, sizeof(title), "[廢除舊板] %s", topic);
snprintf(genbuf, sizeof(genbuf),
"%s\n\n%s%s\n", "廢除舊板", "英文名稱: ", topic);
@@ -286,6 +291,11 @@ do_voteboard(int type)
&completeboard_compar,
&completeboard_permission,
&completeboard_getname);
+ if (!getbnum(topic))
+ {
+ vmsg("無此看版。");
+ return FULLUPDATE;
+ }
snprintf(title, sizeof(title), "[連署板主] %s", topic);
snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s%s", "連署板主", "英文名稱: ", topic, "申請 ID : ", cuser.userid);
strcat(genbuf, "\n申請政見: \n");
@@ -298,6 +308,11 @@ do_voteboard(int type)
&completeboard_compar,
&completeboard_permission,
&completeboard_getname);
+ if (!getbnum(topic))
+ {
+ vmsg("無此看版。");
+ return FULLUPDATE;
+ }
snprintf(title, sizeof(title), "[罷免板主] %s", topic);
snprintf(genbuf, sizeof(genbuf),
"%s\n\n%s%s\n%s", "罷免板主", "英文名稱: ",