[SERVER-22747] Coverity analysis defect 10465: Argument cannot be negative Created: 18/Feb/16  Updated: 05/Jul/16  Resolved: 07/Jun/16

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: 3.3.9

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Kenneth Lee
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 15 (06/03/16), Platforms 16 (06/24/16)
Participants:

 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.



 Comments   
Comment by Githook User [ 06/Jun/16 ]

Author:

{u'name': u'Kenneth Lee', u'email': u'kenneth.lee@mongodb.com'}

Message: SERVER-22747 Fixed coverity analysis bug can't be negative
Branch: master
https://github.com/mongodb/mongo/commit/532168ad65dd0e616f2e13aa1008586a531adb4f

Generated at Thu Feb 08 04:01:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.