summaryrefslogtreecommitdiffstats
path: root/mbbsd/read.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 01:07:22 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 01:07:22 +0800
commit39e89de3c447236d6ea5df7295816947ab7b457f (patch)
treecc49dacafaa5436d52e37e7cf97b876bb372d3e2 /mbbsd/read.c
parente72e1b5e84b76761878f3099f772597b6a23f558 (diff)
downloadpttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.tar
pttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.tar.gz
pttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.tar.bz2
pttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.tar.lz
pttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.tar.xz
pttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.tar.zst
pttbbs-39e89de3c447236d6ea5df7295816947ab7b457f.zip
fix wrong range of key, check whether the func is null first
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1411 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/read.c')
-rw-r--r--mbbsd/read.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c
index fd28bcea..254678a8 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -783,8 +783,10 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int ch, int bid)
default:
if( ch == 'h' && currmode & (MODE_ETC | MODE_DIGEST) )
return DONOTHING;
- if (ch > 0 && ch < onekey_size) {
- mode = (*(rcmdlist[ch - 1]))(locmem->crs_ln, &headers[locmem->crs_ln - locmem->top_ln], currdirect);
+ if (ch > 0 && ch <= onekey_size) {
+ int (*func)() = rcmdlist[ch - 1];
+ if (func != NULL)
+ mode = (*func)(locmem->crs_ln, &headers[locmem->crs_ln - locmem->top_ln], currdirect);
break;
}
}