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

 
 

bug #44845: Invalid conversions of error msg to wstring

Submitter:  None
Submitted:  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
Open/Closed:  Open Release:  * 3.4.3
Reproducibility:  None Fixed Release:  3.5.0
* Mandatory Fields

Add a New Comment Rich Markup
   

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

See commit
f66f62e21c1aed7389129155965f00f8f290f349

Bussenot Jean-Loup <bussenot>
Group administrator
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.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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.13-cf05.
    Corresponding source code