Coverity analysis defect 175114: Overflowed constant

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • ALL
    • QE 2025-09-29
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:245: INTEGER_OVERFLOW 175114 Function "pcre2_substitute_8(this->_code.operator pcre2_code_8 *(), (PCRE2_SPTR8)str->c_str(), str->size(), startPos, static_cast<uint32_t>(trialOptions.operator uint32_t()), NULL, NULL, (PCRE2_SPTR8)replacement.rawData(), replacement.size(), (PCRE2_UCHAR8 *)buf.data(), &bufSize)" modifies its argument, assigning -1 to "bufSize".
      /src/mongo/util/pcre.cpp:259: INTEGER_OVERFLOW 175114 Expression "bufSize + 1UL", where "bufSize" is known to be equal to 18446744073709551615, overflows the type of "bufSize + 1UL", which is type "unsigned long".

            Assignee:
            Niels Lohmann
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: