You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bob Callaway (Created) (JIRA)" <ji...@apache.org> on 2011/12/08 19:07:39 UTC

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

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
            Priority: Minor


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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165419#comment-13165419 ] 

Roger Meier commented on THRIFT-1455:
-------------------------------------

Thanks for figuring out this issue!

Could you provide a patch for that issue?
see http://wiki.apache.org/thrift/HowToContribute

-roger
                
> 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
>            Priority: Minor
>
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira