summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-10-23 19:10:10 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-10-23 19:10:10 (GMT)
commit060a5cc121be5fd177b5d5c834f2b810dc58b9ec (patch)
tree5a380076846df1c0ef7ffd294f6a9e5679d1733e
parent2937e44299a615628c27b0a0a7a95ffdf18249ef (diff)
downloadDoxygen-060a5cc121be5fd177b5d5c834f2b810dc58b9ec.zip
Doxygen-060a5cc121be5fd177b5d5c834f2b810dc58b9ec.tar.gz
Doxygen-060a5cc121be5fd177b5d5c834f2b810dc58b9ec.tar.bz2
Added guard to prevent (theoretical) out of bound access
-rw-r--r--src/index.cpp10
1 files 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<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);
@@ -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();