Skip to content

Commit

Permalink
Added guard to prevent (theoretical) out of bound access
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Oct 23, 2014
1 parent 2937e44 commit 060a5cc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.cpp
Expand Up @@ -2158,7 +2158,8 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
const LetterToIndexMap<MemberIndexList> &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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 060a5cc

Please sign in to comment.