You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Kevin Clark (JIRA)" <ji...@apache.org> on 2008/11/24 19:59:44 UTC

[jira] Commented: (THRIFT-213) Thrift::Serializer can become corrupt

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