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

Coverity analysis defect 134121: Bad bit shift operation

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • Security 2022-11-28, Security 2022-12-12

      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/crypto/fle_crypto.cpp:3707: BAD_SHIFT 134121 Function call "bits_range_dec.toIntExact(mongo::Decimal128::kRoundTowardPositive)" may return -2147483648.
      /src/mongo/crypto/fle_crypto.cpp:3707: BAD_SHIFT 134121 Assigning: "bits_range" = "bits_range_dec.toIntExact(mongo::Decimal128::kRoundTowardPositive)". The value of "bits_range" is now -2147483648.
      /src/mongo/crypto/fle_crypto.cpp:3755: BAD_SHIFT 134121 In expression "1ULL << bits_range", shifting by a negative amount has undefined behavior. The shift amount, "bits_range", is -2147483648.

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: