From 3bf50615cd8a85bec21d0dab1ecf39a26c0e104b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 17 Jan 2015 22:37:31 +0300 Subject: Fix out of bound issue in mapindex.c. Found by coverity scan. --- src/common/mapindex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 0d8a69726..79125e010 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -126,7 +126,7 @@ unsigned short mapindex_name2id(const char* name) { } const char* mapindex_id2name_sub(unsigned short id,const char *file, int line, const char *func) { - if (id > MAX_MAPINDEX || !mapindex_exists(id)) { + if (id >= MAX_MAPINDEX || !mapindex_exists(id)) { ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache. %s:%s:%d\n", id,file,func,line); return mapindex->list[0].name; // dummy empty string so that the callee doesn't crash } -- cgit v1.2.3-60-g2f50