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

Coverity analysis defect 144328: Out-of-bounds read

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 8.0.0-rc0
    • Component/s: Internal Code
    • Storage Execution
    • ALL
    • v8.0
    • Execution Team 2024-04-29

      Out-of-bounds read

      Incorrect values read from a different memory region will cause incorrect computations. Out-of-bounds read from a buffer
      /src/mongo/db/storage/key_string.cpp:1436: OVERRUN 144328 Function call "mongo::countLeadingZeros64(value)" may return 64.
      /src/mongo/db/storage/key_string.cpp:1436: OVERRUN 144328 Assigning: "bytesNeeded" = "(64 - mongo::countLeadingZeros64(value) + 7) / 8". The value of "bytesNeeded" is now 0.
      /src/mongo/db/storage/key_string.cpp:1440: OVERRUN 144328 Assigning: "firstUsedByte" = "reinterpret_cast<char const *>(&value + 1) - bytesNeeded". "firstUsedByte" now points to byte 8 of "value" (which consists of 8 bytes).

            Assignee:
            wei.hu@mongodb.com Wei Hu
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: