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

Coverity analysis defect 105208: Unintentional integer overflow

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.7
    • Internal Client
    • Fully Compatible
    • ALL
    • Service Arch 2018-12-31

    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

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

            Dates

              Created:
              Updated:
              Resolved: