Assertion failure usign boost::format with Visual C++ 2005

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Assertion failure usign boost::format with Visual C++ 2005

Jean-Sébastien Otis
Hello,


Here is a sample that generates an assertion failure with Visual C++
2005 using boost 1.33.1.
A NULL ptr is passed to std::string::append() by
boost::io::detail::mk_str().


////////////////////////////////////////////////////////////////////
#include <boost/format.hpp>


int main(int argc, char* argv[])
{
     std::string str(""); // Empty string.


     boost::format frmt( "%s" );
     std::string res = ( frmt % str ).str();


     return 0;
}


////////////////////////////////////////////////////////////////////


This is due to all the assert statements added in the new "secure" STL
that is shipped with VC2005.
But still, I don't think passing NULL to string::append() is correct
anyway...


Regards.
J.S.Otis
Software Developper
InnovMetric Software Inc.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users