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

Fix a bug about reading a zero-size map in the compact protocol implementation to lua

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.13.0
    • None
    • Lua - Library
    • None

    Description

      bug in lib/lua/TCompactProtocol.lua, code as follow:

      function TCompactProtocol:readMapBegin()
      local size = self:readVarint32()
      local kvtype = 0
      if size > 0 then
      kvtype = self:readSignByte()
      end
      local ktype = self:getTType(libluabitwise.shiftr(kvtype, 4))
      local vtype = self:getTType(kvtype)
      return ktype, vtype, size
      end

      if the map's size is zero, it should‘t read another byte.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              2er0 zero
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m