Permalink
Browse files

Fix potential null pointer dereference in src/classdef.cpp

  • Loading branch information...
orbitcowboy committed Dec 22, 2014
1 parent ed39dab commit 5743848928ffaeccaaef24dac051aaa9acf2c4b7
Showing with 21 additions and 20 deletions.
  1. +21 −20 src/classdef.cpp
View
@@ -3123,18 +3123,19 @@ void ClassDef::mergeCategory(ClassDef *category)
Protection prot = mi->prot;
//if (makePrivate) prot = Private;
MemberDef *newMd = mi->memberDef->deepCopy();
//printf("Copying member %s\n",mi->memberDef->name().data());
newMd->moveTo(this);
MemberInfo *newMi=new MemberInfo(newMd,prot,mi->virt,mi->inherited);
newMi->scopePath=mi->scopePath;
newMi->ambigClass=mi->ambigClass;
newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope;
newMni->append(newMi);
// also add the newly created member to the global members list
if (newMd)
{
//printf("Copying member %s\n",mi->memberDef->name().data());
newMd->moveTo(this);
MemberInfo *newMi=new MemberInfo(newMd,prot,mi->virt,mi->inherited);
newMi->scopePath=mi->scopePath;
newMi->ambigClass=mi->ambigClass;
newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope;
newMni->append(newMi);
// also add the newly created member to the global members list
MemberName *mn;
QCString name = newMd->name();
if ((mn=Doxygen::memberNameSDict->find(name)))
@@ -3147,17 +3148,17 @@ void ClassDef::mergeCategory(ClassDef *category)
mn->append(newMd);
Doxygen::memberNameSDict->append(name,mn);
}
newMd->setCategory(category);
newMd->setCategoryRelation(mi->memberDef);
mi->memberDef->setCategoryRelation(newMd);
if (makePrivate || isExtension)
{
newMd->makeImplementationDetail();
}
internalInsertMember(newMd,prot,FALSE);
}
newMd->setCategory(category);
newMd->setCategoryRelation(mi->memberDef);
mi->memberDef->setCategoryRelation(newMd);
if (makePrivate || isExtension)
{
newMd->makeImplementationDetail();
}
internalInsertMember(newMd,prot,FALSE);
}
}
// add it to the dictionary
dstMnd->append(newMni->memberName(),newMni);

0 comments on commit 5743848

Please sign in to comment.