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

Coverity analysis defect 120377: Bad bit shift operation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0-rc0
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Execution Team 2021-08-23, Execution Team 2021-09-06

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: