PDB-REDO/dssp

Heap buffer overflow in dssp.cpp

Closed this issue · 1 comments

There is a heap overflow bug in dssp.cpp:

If stop == True then since bool stop = t == dssp.end(); it means that t == dssp.end() and therefore accessing t->ss() will cause a heap buffer overflow.

I think the solution is to move:

if (stop)
  break;

above the if (lastSS != t->ss()) check:

if (stop) {
  break;
}

if (lastSS != t->ss()) {
  st = t;
  lastSS = t->ss();
}

Thanks for pointing this out. It is fixed now.