[ 
https://issues.apache.org/jira/browse/THRIFT-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650280#action_12650280
 ] 

Kevin Clark commented on THRIFT-213:
------------------------------------

Sounds fine. I'm happy to apply a patch that fixes this.

> 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.

Reply via email to