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 | |
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
-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("�L���ݪ��C"); + return FULLUPDATE; + } snprintf(title, sizeof(title), "[�o���ªO] %s", topic); snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n", "�o���ªO", "�^��W��: ", topic); @@ -286,6 +291,11 @@ do_voteboard(int type) &completeboard_compar, &completeboard_permission, &completeboard_getname); + if (!getbnum(topic)) + { + vmsg("�L���ݪ��C"); + return FULLUPDATE; + } snprintf(title, sizeof(title), "[�s�p�O�D] %s", topic); snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s%s", "�s�p�O�D", "�^��W��: ", topic, "�ӽ� ID : ", cuser.userid); strcat(genbuf, "\n�ӽЬF��: \n"); @@ -298,6 +308,11 @@ do_voteboard(int type) &completeboard_compar, &completeboard_permission, &completeboard_getname); + if (!getbnum(topic)) + { + vmsg("�L���ݪ��C"); + return FULLUPDATE; + } snprintf(title, sizeof(title), "[�}�K�O�D] %s", topic); snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s", "�}�K�O�D", "�^��W��: ", |