From 060a5cc121be5fd177b5d5c834f2b810dc58b9ec Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 23 Oct 2014 21:10:10 +0200 Subject: Added guard to prevent (theoretical) out of bound access --- src/index.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.cpp b/src/index.cpp index 96b0f76..bc0b48e 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2158,7 +2158,8 @@ static void writeMemberList(OutputList &ol,bool useSections,int page, const LetterToIndexMap &memberLists, DefinitionIntf::DefType type) { - ASSERT((int)type<3); + int index = (int)type; + ASSERT(index<3); typedef void (*writeLinkForMember_t)(OutputList &ol,MemberDef *md,const char *separator, QCString &prevNamespaceName); @@ -2238,8 +2239,11 @@ static void writeMemberList(OutputList &ol,bool useSections,int page, sep = ", "; // link to class for other members with the same name } - // write the link for the specific list type - writeLinkForMemberMap[(int)type](ol,md,sep,prevDefName); + if (index<3) + { + // write the link for the specific list type + writeLinkForMemberMap[index](ol,md,sep,prevDefName); + } } } if (!firstItem) ol.endItemListItem(); -- cgit v0.12