PR libstdc++/81395 fix crash when write follows large read
authorJonathan Wakely <jwakely@redhat.com>
Tue, 18 Jul 2017 23:39:34 +0000 (00:39 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 18 Jul 2017 23:39:34 +0000 (00:39 +0100)
commitfddcd19abfee871994f63ad22e3a1957b81a7db3
tree9785326f7698aead2fd1798d6c1e62e44969562c
parent6033b55bd90c3e0e857b4a1b54ab1d243377e56e
PR libstdc++/81395 fix crash when write follows large read

PR libstdc++/81395
* include/bits/fstream.tcc (basic_filebuf::xsgetn): Don't set buffer
pointers for write mode after reading.
* testsuite/27_io/basic_filebuf/sgetn/char/81395.cc: New.

From-SVN: r250328
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc [new file with mode: 0644]