Coverity analysis defect 172730: Pointer to local outside scope

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2025-04-28
    • 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
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main/src/mongo/db/s/drop_database_coordinator.cpp:579: RETURN_LOCAL 172730 Assigning: "beforeReleasingAction" = "clearDbInfo ? static_cast<mongo::ShardingRecoveryService::BeforeReleasingCustomAction const &>(mongo::ShardingRecoveryService::FilteringMetadataClearer(false)) : static_cast<mongo::ShardingRecoveryService::BeforeReleasingCustomAction const &>(mongo::ShardingRecoveryService::NoCustomAction())".
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main/src/mongo/db/s/drop_database_coordinator.cpp:579: RETURN_LOCAL 172730 Temporary variable of type "mongo::ShardingRecoveryService::NoCustomAction" goes out of scope.
      /data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main/src/mongo/db/s/drop_database_coordinator.cpp:585: RETURN_LOCAL 172730 Using "beforeReleasingAction", which points to an out-of-scope temporary variable of type "mongo::ShardingRecoveryService::NoCustomAction".

            Assignee:
            Pol Pinol
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: