stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: [PATCH] RE: [jira] Created: (STDCXX-427) SIGSEGV in istringstream::str()
Date Tue, 29 May 2007 17:22:14 GMT
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Saturday, May 26, 2007 3:05 AM
> To: stdcxx-dev@incubator.apache.org
> 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.

Mime
View raw message