    void copyBytes(InStream* is, int length) {
      while (length > 0) {
        int n = check(1, length);
        is->readBytes(ptr, n);
        ptr += n;
        length -= n;
      }
    }
The software writes data past the end, or before the beginning, of the intended buffer.