> -----Original Message-----
> From: Martin Sebor [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, May 26, 2007 3:05 AM
> To: [email protected]
> Subject: Re: [PATCH] RE: [jira] Created: (STDCXX-427) SIGSEGV 
> in istringstream::str()
> 
> >   The bug is in that len calculated as highmark - pbase(), 
> but pbase() 
> > == 0 when buffer opened only in input mode. The begin of 
> the buffer is 
> > always
> > this->_C_buffer with any openmode. So len = highmark - _C_buffer is
> > correct, I think.
> 
> In input mode (only) the function is supposed to return:
> 
>      string(eback(), egptr());
> 
> In output mode (or input | output) the function must return:
> 
>      string(pbase(), high_mark);
> 
> So unless I'm missing something the program below should be a 
> valid (albeit incomplete) test case. Let me know what you think.

  Formally the test case is valid, but logically, I think, the buffer
pointers and the buffer
itself should be in consistency, and in this test eback() and pbase()
are changed from
the real begin of the buffer of the std::stringbuf.

Farid.

Reply via email to