Commit 060a5cc1 authored by Dimitri van Heesch's avatar Dimitri van Heesch
Browse files

Added guard to prevent (theoretical) out of bound access

parent 2937e442
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -2158,7 +2158,8 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
                            const LetterToIndexMap<MemberIndexList> &memberLists,
                            const LetterToIndexMap<MemberIndexList> &memberLists,
                            DefinitionIntf::DefType type)
                            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,
  typedef void (*writeLinkForMember_t)(OutputList &ol,MemberDef *md,const char *separator,
                                   QCString &prevNamespaceName);
                                   QCString &prevNamespaceName);
@@ -2238,8 +2239,11 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
        sep = ", ";
        sep = ", ";
        // link to class for other members with the same name
        // link to class for other members with the same name
      }
      }
      if (index<3)
      {
        // write the link for the specific list type
        // write the link for the specific list type
      writeLinkForMemberMap[(int)type](ol,md,sep,prevDefName);
        writeLinkForMemberMap[index](ol,md,sep,prevDefName);
      }
    }
    }
  }
  }
  if (!firstItem) ol.endItemListItem();
  if (!firstItem) ol.endItemListItem();