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

Coverity analysis defect 120377: Bad bit shift operation

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • Execution Team 2021-08-23, Execution Team 2021-09-06

      Bad bit shift operation

      The operation may have an undefined behavior or yield an unexpected result. A bit shift operation has a shift amount which is too large or has a negative value.
      /src/mongo/bson/util/simple8b.cpp:422: BAD_SHIFT 120377 Checking "trailingZerosCount == 124" implies that "trailingZerosCount" is 124 on the true branch.
      /src/mongo/bson/util/simple8b.cpp:423: BAD_SHIFT 120377 In expression "value >> trailingZerosCount", right shifting by more than 63 bits has undefined behavior. The shift amount, "trailingZerosCount", is 124.

            Assignee:
            luke.bhan@mongodb.com Luke Bhan (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: