diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-24 20:39:34 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-24 20:39:34 +0800 |
commit | 64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1 (patch) | |
tree | 6bbba49feaab9bb957e4451af909b443e13d8f4f /mbbsd | |
parent | 646508046d2f7c99f805f4da52bf22accbe75b64 (diff) | |
download | pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.tar pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.tar.gz pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.tar.bz2 pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.tar.lz pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.tar.xz pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.tar.zst pttbbs-64c564fd9ebdc166aa8b269e0bbe7a4928a81ce1.zip |
- 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
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/voteboard.c | 15 |
1 files changed, 15 insertions, 0 deletions
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", "罷免板主", "英文名稱: ", |