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

XMLWordPrintableJSON

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

      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
            Reporter:
            Yuhong Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: