Hi Guys, When BIO_reset the read-only memory, does the below code assume that: the bm's init state is bm->length == bm->max ?? if not , the below code will cause the bm->data point to the wrong address.
case BIO_CTRL_RESET:
if (bm->data != NULL)
{
/* For read only case reset to the start again */
if(b->flags & BIO_FLAGS_MEM_RDONLY)
{
bm->data -= bm->max - bm->length;
bm->length = bm->max;
}
else
{
memset(bm->data,0,bm->max);
bm->length=0;
}
}
Thanks,
Qiang.
