diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-06 09:34:53 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-06 09:34:53 +0800 |
commit | c2e56d6f9cb81fee8f9979067da508511766f1fe (patch) | |
tree | 9a8ef597ad7701aec8c7fe8d1e55ea24007a278d /mbbsd/cache.c | |
parent | c08de1e541bd49d66ecec4bfac3c83615ade54aa (diff) | |
download | pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.tar pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.tar.gz pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.tar.bz2 pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.tar.lz pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.tar.xz pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.tar.zst pttbbs-c2e56d6f9cb81fee8f9979067da508511766f1fe.zip |
- fix crash on cross-posting to non-exist boards (reported by astro)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4274 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r-- | mbbsd/cache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 5b1f17f3..7102894b 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -764,6 +764,9 @@ postperm_msg(const char *bname) char buf[PATHLEN]; boardheader_t *bp = NULL; + if (!(i = getbnum(bname))) + return "看板不存在"; + if (HasUserPerm(PERM_SYSOP)) return NULL; @@ -774,9 +777,6 @@ postperm_msg(const char *bname) if (!strcasecmp(bname, DEFAULT_BOARD)) return NULL; - if (!(i = getbnum(bname))) - return "看板不存在"; - assert(0<=i-1 && i-1<MAX_BOARD); bp = getbcache(i); |