Boost C++ Libraries: Ticket #11956: NULL values to a basic_formatting_ostream causes an error https://svn.boost.org/trac10/ticket/11956 <p> Doing the following causes a segfault: </p> <p> char* msg = nullptr; BOOST_LOG_TRIVIAL(trace) &lt;&lt; msg; </p> <p> It causes a call to std::char_traits&lt;char&gt;::length on the 'msg' above, which causes a segfault. </p> <p> I would anticipate that this functionality match the standard ostream version of the same thing, which is to not print at all, or at least the printf formatting, which prints (null). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11956 Trac 1.4.3 Andrey Semashev Thu, 04 Feb 2016 23:55:50 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11956#comment:1 https://svn.boost.org/trac10/ticket/11956#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> This is not a bug in the library. Null C-style strings are not a valid data to output - neither with iostreams nor with printf nor with Boost.Log. </p> Ticket