From 64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 24 May 2009 12:39:34 +0000 Subject: - fix: crash when input board name was invalid in voteboard (thanks: LukET@PttBug) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4473 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/voteboard.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index f9af60ff..8badcf0f 100644 --- a/mbbsd/voteboard.c +++ b/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", "罷免板主", "英文名稱: ", -- cgit v1.2.3