[MOAB-dev] Bug in HomCoord constructor

putanowr R.Putanowicz at L5.pk.edu.pl
Fri May 12 20:18:44 CDT 2017


Hello,

Looking at the code of HomCoord constructor

inline HomCoord::HomCoord(const int coords[], const int num_coords)
{
  for (int tmpj = 0; tmpj < num_coords; tmpj++) homCoord[tmpj] =
coords[tmpj];
  if (num_coords != 4) homCoord[3] = 1;
}

I see a bug in it because if called with num_coords < 3 then some
of homCoord[] are uniinitialized.

The fix is obvious, add a line:
homCoord[0] = homCoord[1] = homCoord[2] = 0;

Best regards, 

Roman 

--
Roman Putanowicz, PhD  < putanowr at l5.pk.edu.pl  >
Institute for Computational Civil Engng (L-5)
Dept. of Civil Engng, Cracow Univ. of Technology
www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034






More information about the moab-dev mailing list