diff options
-rw-r--r-- | src/gdbmsetopt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gdbmsetopt.c b/src/gdbmsetopt.c index db19f5c..eedfef6 100644 --- a/src/gdbmsetopt.c +++ b/src/gdbmsetopt.c @@ -336,7 +336,8 @@ gdbm_setopt (GDBM_FILE dbf, int optflag, void *optval, int optlen) GDBM_ASSERT_CONSISTENCY (dbf, -1); if (optflag >= 0 - && optflag < sizeof (setopt_handler_tab) / sizeof (setopt_handler_tab[0])) + && optflag < sizeof (setopt_handler_tab) / sizeof (setopt_handler_tab[0]) + && setopt_handler_tab[optflag]) return setopt_handler_tab[optflag] (dbf, optval, optlen); GDBM_SET_ERRNO (dbf, GDBM_OPT_ILLEGAL, FALSE); |