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

Coverity analysis defect 105208: Unintentional integer overflow

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.7
    • Affects Version/s: None
    • Component/s: Internal Client
    • Fully Compatible
    • ALL
    • Service Arch 2018-12-31

      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),
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: