Page MenuHomePhabricator

mbilog crashes
Closed, DuplicatePublic

Description

This is an email from Michael Kelm, sent to mitk-users:

Dear developers,

I was trying to check out the new MITK. Unfortunately it crashes immediately (ExtApp as well as CoreApp) due to a bug in mpilog.cpp.
In line 517 std::size_t size = path.size() - 3 has an underflow if path.size() < 3 which causes an out-of-bounds index in line 518. This happens for me since I have got the string "." in the path vector. I am using the latest trunk version (rev 20708). Is there a fix/workaround? I have no idea what this function is supposed to do...

bool search2p2(char *a,char *b,bool optimize=true)
{

517 std::size_t size = path.size() - 3;

for(std::size_t r=0;r<size;r++)

518 if(path[r].compare(a)==0 && path[r+1].compare(b)==0)

    {
      pos = r+2;
      category = concat(simplify(path[pos]),simplify(path[path.size()-1]),optimize);
      return true;
    }
  return false;
}

Best,
Michael.