get_maphash: fix off-by-one

Patch-by: oni-link <knil.ino@gmail.com>

ref: https://github.com/neovim/neovim/pull/6236#discussion_r195113807
This commit is contained in:
Justin M. Keyes 2018-06-14 18:51:35 +02:00
parent c46997aa87
commit c990d65c37

View File

@ -4249,7 +4249,7 @@ static bool typebuf_match_len(const uint8_t *str, int *mlen)
mapblock_T *get_maphash(int index, buf_T *buf)
FUNC_ATTR_PURE
{
if (index > MAX_MAPHASH) {
if (index >= MAX_MAPHASH) {
return NULL;
}