Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71360

Casting value from a byte can be out of range for BinDataType

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc3, 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v6.2
    • Execution Team 2022-11-28
    • 137

      BinDataType enum has the range of 0 to 255. But when we read the subtype byte from a BSON object as signed values, the arithmetic can result in huge numbers. Casting it to the enum can be out of range, resulting in undefined behaviors. 

            Assignee:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Reporter:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: