int FileInStream::pos()
{
  if (!file)
    throw Exception("File is not open");

  return ftell(file) + ptr - b;
}
The software writes data past the end, or before the beginning, of the intended buffer.