This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/81380] New: basic_stringbuf::seekoff doesn't fail when trying to reposition a null sequence
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 10 Jul 2017 13:59:40 +0000
- Subject: [Bug libstdc++/81380] New: basic_stringbuf::seekoff doesn't fail when trying to reposition a null sequence
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81380
Bug ID: 81380
Summary: basic_stringbuf::seekoff doesn't fail when trying to
reposition a null sequence
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
#include <sstream>
#include <cassert>
int main()
{
std::stringbuf sb("foo", std::ios::in);
assert(sb.pubseekoff(1, std::ios::beg) == -1);
assert(sb.pubseekpos(1) == -1);
}
The second assertion should be equivalent to the first ([stringbuf.virtuals]
p13) but it fails:
seekpos: seekpos.cc:8: int main(): Assertion `sb.pubseekpos(1) == -1' failed.
Aborted (core dumped)