You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ben Craig (JIRA)" <ji...@apache.org> on 2013/08/28 23:45:53 UTC

[jira] [Resolved] (THRIFT-1455) TBinaryProtocolT::writeString casts from size_t to uint32_t, which is not safe on 64-bit platforms

     [ https://issues.apache.org/jira/browse/THRIFT-1455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig resolved THRIFT-1455.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.1
         Assignee: Ben Craig
    
> TBinaryProtocolT<Transport_>::writeString casts from size_t to uint32_t, which is not safe on 64-bit platforms
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1455
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>         Environment: gcc 4.4.4, 64 bit Linux (with -Werror and -Wconversion compile flags)
>            Reporter: Bob Callaway
>            Assignee: Ben Craig
>            Priority: Minor
>             Fix For: 0.9.1
>
>
> The first line in this method sets the size based on the string length, which is of size_t type. On a 64-bit platform, the cast from a 64 bit unsigned integer to a 32 bit unsigned integer can result in incomplete data being written. 
> With my compiler flags (-Werror and -Wconversion), I can't compile my code that includes the client library headers. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira