Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 285 by [email protected]: Generated C++ operator= to CopyFrom() to MergeFrom() mishandles bytes fields as strings
http://code.google.com/p/protobuf/issues/detail?id=285

What steps will reproduce the problem?
1. Create a field of type 'bytes'
2. Assign it a value "\0\0\0\0abc"
3. Assign to make a copy

What is the expected output? What do you see instead?
I expect the data "\0\0\0\0abc" to be copied to the destination, but instead the generated MergeFrom() function treats the field as type string that copies no data because it's interpreted as an empty string due to the leading zero using:

set_fieldname(from.fieldname().c_str());

What version of the product are you using? On what operating system?
Protocol Buffers v2.3.0, Windows 7, C++

Please provide any additional information below.


--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to