Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1455

TBinaryProtocolT<Transport_>::writeString casts from size_t to uint32_t, which is not safe on 64-bit platforms

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.9.2
    • C++ - Library
    • None
    • gcc 4.4.4, 64 bit Linux (with -Werror and -Wconversion compile flags)

    Description

      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.

      Attachments

        Activity

          People

            ben.craig Ben Craig
            rcallawa@us.ibm.com Bob Callaway
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: