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

Coverity analysis defect 123341: Pointer to local outside scope

    • Fully Compatible
    • ALL
    • Sharding 2022-08-08, Sharding 2022-08-22

      Pointer to local outside scope

      Dereferencing the returned or out-of-scope stack pointer will access an invalid location on the stack after its scope or after the function returns. Pointer to a local stack variable returned or used outside scope
      /src/mongo/db/internal_session_pool.cpp:103: RETURN_LOCAL 123341 Address of temporary holding "mongo::LogicalSessionId(mongo::makeSystemLogicalSessionId())".
      /src/mongo/db/internal_session_pool.cpp:103: RETURN_LOCAL 123341 Assigning: "systemUserDigest" = "mongo::LogicalSessionId(mongo::makeSystemLogicalSessionId()).getUid()".
      /src/mongo/db/internal_session_pool.cpp:103: RETURN_LOCAL 123341 Temporary variable of type "mongo::LogicalSessionId" goes out of scope.
      /src/mongo/db/internal_session_pool.cpp:104: RETURN_LOCAL 123341 Using "systemUserDigest", which points to an out-of-scope temporary variable of type "mongo::LogicalSessionId".

            Assignee:
            sanika.phanse@mongodb.com Sanika Phanse (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: