bugCERTI - Bugs: bug #32162, std::wstring is not handled...

 
 

bug #32162: std::wstring is not handled properly

Submitted by:  None
Submitted on:  Tue 18 Jan 2011 07:20:29 AM UTC  
 
Category: CERTISeverity: 3 - Normal
Item Group: Software errorStatus: Ready For Test
Privacy: PublicAssigned to: Eric NOULARD <erk>
Open/Closed: ClosedRelease: 3.4.0
Reproducibility: NoneFixed Release: 3.4.1

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 18 Jan 2011 01:29:39 PM UTC, comment #2:

Fix just commited to CVS HEAD.
The BasicMessage change is slightly different
from the proposed one but it should do the job.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Tue 18 Jan 2011 01:25:56 PM UTC, comment #1:

Thank you for the report,
I'm taking care of this.

If you can please register a [free] Savannah account and
report a bug while logged in.
That way you'll get automatic follow-up.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Tue 18 Jan 2011 07:20:29 AM UTC, original submission:

Methods devoted to std::wstring handling (HLA 1516-2000 compatible methods) has some bugs.

-----------------------------

1) RTI1516Ambassador.cpp:125

// old code does not allow to pass null bytes due to selected std::string constructor.

/char buf = (char*) calloc(varLengthData.size() + 1, sizeof(char));
memcpy(buf, varLengthData.data(), varLengthData.size());
std::string retVal(buf);
free(buf);*/

// proposed fix

std::string retVal( (char*)varLengthData.data(), varLengthData.size() );

-----------------------------

2) BasicMessage.cc:126

// original code reads string instantly to the label message attribute, and it does not affect wLabel attribute value. Unchanged wLabel and wTag result in errors in callback parameters.

if (_isLabelled) {
msgBuffer.read_string(label);
}
_isTagged = msgBuffer.read_bool();
if (_isTagged) {
msgBuffer.read_string(tag);
}

// proposed fix

if (_isLabelled) {
std::string label;
msgBuffer.read_string(label);
setLabel( label );
}
_isTagged = msgBuffer.read_bool();
if (_isTagged) {
msgBuffer.read_string(tag);
wTag = std::wstring( tag.begin(), tag.end() );
}

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 erk (Posted a comment)
  •  

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

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 18 Oct 2011 08:36:06 PM UTCerkOpen/ClosedOpen=>Closed
      Fixed ReleaseCVS=>3.4.1
    Tue 18 Jan 2011 01:29:39 PM UTCerkStatusIn Progress=>Ready For Test
      Fixed ReleaseUnknown=>CVS
    Tue 18 Jan 2011 01:25:56 PM UTCerkCategoryNone=>CERTI
      StatusNone=>In Progress
      Assigned toNone=>erk

    Back to the top


    Powered by Savane 3.1-cleanup1