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

Coverity analysis defect 105208: Unintentional integer overflow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.7
    • Component/s: Internal Client
    • Labels:

      Description

      An integer overflow occurs, with the result converted to a wider integer type

      Defect 105208 (STATIC_C)
      Checker OVERFLOW_BEFORE_WIDEN (subcategory none)
      File: /src/mongo/client/replica_set_monitor.cpp
      Function mongo::ReplicaSetMonitor::SetState::SetState(mongo::StringData, const std::set<mongo::HostAndPort, std::less<mongo::HostAndPort>, std::allocator<mongo::HostAndPort>> &, mongo::executor::TaskExecutor *, mongo::MongoURI)
      /src/mongo/client/replica_set_monitor.cpp, line: 1022
      Potentially overflowing expression "mongo::serverGlobalParams.defaultLocalThresholdMillis * 1000" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "int64_t" (64 bits, signed).

                latencyThresholdMicros(serverGlobalParams.defaultLocalThresholdMillis * 1000),

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: