    void writeBytes(const void* data, int length) {
      check(length);
      memcpy(ptr, data, length);
      ptr += length;
    }
The software writes data past the end, or before the beginning, of the intended buffer.