[
https://issues.apache.org/jira/browse/THRIFT-213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bryan Duxbury closed THRIFT-213.
--------------------------------
Resolution: Invalid
I didn't read closely enough. The memory buffer is cleared at the start of
every serialize call, meaning even if there was garbage in the buffer, it'd be
gone by the next time serialization started.
> Thrift::Serializer can become corrupt
> -------------------------------------
>
> Key: THRIFT-213
> URL: https://issues.apache.org/jira/browse/THRIFT-213
> Project: Thrift
> Issue Type: Bug
> Components: Library (Ruby)
> Reporter: Bryan Duxbury
>
> There's a bug in Thrift::Serializer that can cause you to get corrupted data.
> If there is any error while calling struct.write(), then the partially
> written data will still be in the buffer. If you subsequently reuse the
> Serializer, then your perfectly good data will have some garbage out in front
> of it.
> To avoid this situation, all we have to do is trap any errors while writing,
> and if there's a failure, clear the memory buffer and rethrow the exception.
> This way you won't have an insidious data corruption bug.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.