Qpid
  1. Qpid
  2. QPID-4820

Variant decoding/conversion incorrect for at least bin8, int8, uint8 data types

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.23
    • Component/s: None
    • Labels:
      None

      Description

      In the toVariant method in Codecs.cpp (https://github.com/apache/qpid/blob/trunk/qpid/cpp/src/qpid/amqp_0_10/Codecs.cpp#L99), the case statements for bin8, int8, and uint8 are incorrect.

      bin8 should be 0x00 (it's currently 0x01)
      int8 should be 0x01 (it's currently 0x02)
      uint8 should be 0x02 (it's currently 0x03)

      If you send a message like

      message.getProperties["key"] = boost::uint8_t(255)

      When you receive it, the value of that property comes out as -1, as the client incorrectly decodes the uint8 as an int8.

      It might be worth reviewing the entire switch block to see if anything else needs adjusting.

        Activity

        Andy Goldstein created issue -
        Gordon Sim made changes -
        Field Original Value New Value
        Assignee Gordon Sim [ gsim ]
        Show
        Gordon Sim added a comment - Fixed by http://svn.apache.org/viewvc?view=revision&revision=1480327
        Gordon Sim made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.23 [ 12324273 ]
        Resolution Fixed [ 1 ]
        Hide
        Justin Ross added a comment -
        Show
        Justin Ross added a comment - Released in Qpid 0.24, http://qpid.apache.org/releases/qpid-0.24/index.html
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1h 23m 1 Gordon Sim 08/May/13 16:39
        Resolved Resolved Closed Closed
        122d 21h 57m 1 Justin Ross 08/Sep/13 14:37

          People

          • Assignee:
            Gordon Sim
            Reporter:
            Andy Goldstein
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development