Coverity analysis defect 10465: Argument cannot be negative

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.3.9
    • Affects Version/s: None
    • Component/s: Logging
    • None
    • Fully Compatible
    • ALL
    • Platforms 15 (06/03/16), Platforms 16 (06/24/16)
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Kenneth Lee (Inactive)
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: