Coverity analysis defect 123341: Pointer to local outside scope

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: