bugCERTI - Bugs: bug #44845, Invalid conversions of error msg...


bug #44845: Invalid conversions of error msg to wstring

Submitted by:  None
Submitted on:  Wed 15 Apr 2015 10:39:12 AM UTC  
Category:  CERTI Severity:  3 - Normal
Item Group:  Software error Status:  Fixed
Privacy:  Public Assigned to:  Bussenot Jean-Loup <bussenot>
Open/Closed:  Open Release:  3.4.3
Reproducibility:  None Fixed Release:  3.5.0

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 06 May 2015 02:39:18 PM UTC, comment #1: 

See commit

Bussenot Jean-Loup <bussenot>
Project AdministratorIn charge of this item.
Wed 15 Apr 2015 10:39:12 AM UTC, original submission:  

While generating exceptions, libRTIieee1516-2010RTIambassadorImplementation.cpp (and libRTIieee1516-2010RTIambassadorImplementation.cpp) create error messages as follows:

catch (NetworkError &e) {
    std::stringstream msg;
    msg << "NetworkError in tick() while receiving response: " << e._reason;
    std::wstring message(msg.str().begin(), msg.str().end());
    throw rti1516::RTIinternalError(message);

While converting 'msg' to 'message' CERTI thus calls msg.str() twice, which yields different string objects. The begin() and end() iterator are then incompatible and MSVC 2012 notifies me of this error.

The solution is simple: Call msg.str() once, and use begin() and end() on the same string object.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bussenot (Posted a comment)



    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-07 bussenot StatusIn Progress => Fixed
    2015-05-06 bussenot StatusNone => In Progress
        Assigned toNone => bussenot
        Fixed ReleaseUnknown => 3.5.0

    Back to the top

    Powered by Savane 3.6