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: CERTISeverity: 3 - Normal
Item Group: Software errorStatus: Fixed
Privacy: PublicAssigned to: Bussenot Jean-Loup <bussenot>
Open/Closed: OpenRelease: 3.4.3
Reproducibility: NoneFixed 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
f66f62e21c1aed7389129155965f00f8f290f349

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.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 07 May 2015 12:53:51 PM UTCbussenotStatusIn Progress=>Fixed
    Wed 06 May 2015 02:39:18 PM UTCbussenotStatusNone=>In Progress
      Assigned toNone=>bussenot
      Fixed ReleaseUnknown=>3.5.0

    Back to the top


    Powered by Savane 3.1-cleanup1