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

Coverity analysis defect 10465: Argument cannot be negative

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.3.9
    • None
    • Logging
    • None
    • Fully Compatible
    • ALL
    • Platforms 15 (06/03/16), Platforms 16 (06/24/16)

    Description

      Negative value used as argument to a function expecting a positive value (for example, size of buffer or allocation)

      Defect 10465 (STATIC_C)
      Checker NEGATIVE_RETURNS (subcategory critical_argument)
      File: /src/mongo/util/logfile.cpp
      Function mongo::LogFile::synchronousAppend(const void *, unsigned long)
      /src/mongo/util/logfile.cpp, line: 244
      Function "lseek(this->_fd, 0L, 1)" returns a negative number.
      /src/mongo/util/logfile.cpp, line: 244
      Assigning: signed variable "pos" = "lseek".
      /src/mongo/util/logfile.cpp, line: 272
      "pos" is passed to a parameter that cannot be negative.

      Attachments

        Activity

          People

            kenneth.lee Kenneth Lee
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: