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

        

Reply via email to