[Bug libstdc++/97415] Invalid pointer comparison in stringbuf::str() (reported by pointer-compare AddressSanitizer)

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 14 13:27:16 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97415

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-10-14
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This should reproduce it, but doesn't for some reason:

#include <bits/c++config.h>
#undef _GLIBCXX_EXTERN_TEMPLATE
#include <sstream>

int main()
{
  std::ostringstream s;
  s << ".";
  return s.str().length();
}


More information about the Gcc-bugs mailing list