< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] String corruption?


In os\data.cxx

const char*
Data::c_str() const
{
   own();

   if (mSize >= mCapacity)      // !ah! we were overwritting the end
   {                            // !ah! when mSize == mCapacity !!
       const_cast<Data*>(this)->resize(mSize+1,true);
   }
   // mostly is zero terminated, but not by DataStream
   mBuf[mSize] = 0;
   return mBuf;
}

Does the comment imply that mSize should never be greater than mCapacity
and if it was it would mean memory corruption? Could that explain the crash
I am experiencing in the delete operator?

Thanks!
CG