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

Coverity analysis defect 120377: Bad bit shift operation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.1.0-rc0
    • None
    • Fully Compatible
    • ALL
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: