Opened 10 years ago

Closed 10 years ago

#7384 closed Bugs (fixed)

Serializing binary object to text or xml reads outside specified memory

Reported by: cjgreen@… Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.51.0 Severity: Problem
Keywords: binary object serialization Cc:

Description

When writing a binary object (using make_binary_object) to a text or xml archive, the serialization seems to read beyond the specified size. Initially this error was reported by valgrind, and I then confirmed the file written by the archive changes when the data beyond the specified size varies. So it is reading at least 1 byte beyond the size specified to make_binary_object.

I have seen this on boost 1.49.0 and the current svn version.

A small program that reproduces this problem is attached, as well as the valgrind output I get when running this program if the extraSpace variable is set to 0. This program tests all of the possible values for the memory beyond the serializedSize and write them to files. The last letter (before the ==) then varies from A-P.

This was tested on linux.

Attachments (2)

boostSerializationTest.cpp (1.1 KB ) - added by anonymous 10 years ago.
valgrindOut.txt (10.0 KB ) - added by anonymous 10 years ago.

Download all attachments as: .zip

Change History (5)

by anonymous, 10 years ago

Attachment: boostSerializationTest.cpp added

by anonymous, 10 years ago

Attachment: valgrindOut.txt added

comment:1 by Robert Ramey, 10 years ago

I've made changes to code to address this specific issue. I've checked in the changes to the trunk. Please check to see that this problem is addressed.

Robert Ramey

in reply to:  1 comment:2 by cjgreen@…, 10 years ago

That fixed my issue. Thank you.

comment:3 by Robert Ramey, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.