Page MenuHomePhabricator

Possible nullptr dereferencing in plane geometry 3D mapper
Open, NormalPublic


There is an 'if' condition with an assignment and a nullptr check, then if the just assigned value is null, the variable is used.

I discovered this accidentally when I was browsing the code. It did not cause a crash for me, probably the condition never fulfills.;54c4495d75937c24e6ad1ef59f8a472bbff4f8b1$246

if ((surfacecreatorprop.IsNull()) || (surfacecreatorprop->GetSmartPointer().IsNull()) ||
    ((m_SurfaceCreator =
        dynamic_cast<PlaneGeometryDataToSurfaceFilter *>(surfacecreatorprop->GetSmartPointer().GetPointer()))
  surfacecreatorprop = SmartPointerProperty::New(m_SurfaceCreator);
  GetDataNode()->SetProperty("surfacegeometry", surfacecreatorprop);