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

Coverity analysis defect 143399: Overflowed constant

    • Query Execution
    • Fully Compatible
    • ALL
    • v8.1, v8.0, v7.0
    • QE 2025-03-17

      Overflowed constant

      The overflowed value due to arithmetic on constants is too small or unexpectedly negative, causing incorrect computations. Integer overflow occurs in arithmetic on constant operands
      /src/mongo/util/pcre.cpp:399: INTEGER_OVERFLOW 143399 Function "pcre2_match_8(this->_regex->code(), (PCRE2_SPTR8)this->_input.rawData(), this->_input.size(), startPos, static_cast<uint32_t>(options.operator uint32_t()), this->_data.get(), NULL)" returns -33.
      /src/mongo/util/pcre.cpp:399: INTEGER_OVERFLOW 143399 "matched" = "pcre2_match_8(this->_regex->code(), (PCRE2_SPTR8)this->_input.rawData(), this->_input.size(), startPos, static_cast<uint32_t>(options.operator uint32_t()), this->_data.get(), NULL)", its value is now -33.
      /src/mongo/util/pcre.cpp:408: INTEGER_OVERFLOW 143399 Expression "this->_highestCaptureIndex", which is equal to -33, where "matched" is known to be equal to -33, underflows the type that receives it, an unsigned integer 64 bits wide.

            Assignee:
            jan.steemann@mongodb.com Jan Steemann
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: