[CDRIVER-2134] Coverity analysis defect 49582: Operands don't affect result Created: 21/Apr/17  Updated: 28/Oct/23  Resolved: 09/May/17

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.7.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-852 Document that timeout_msec is unused ... Closed

 Description   

An operation with non-constant operands that computes a result with constant value

Defect 49582 (STATIC_C)
Checker CONSTANT_EXPRESSION_RESULT (subcategory result_independent_of_operands)
File: /src/mongoc/mongoc-stream-gridfs.c
Function _mongoc_stream_gridfs_readv
/src/mongoc/mongoc-stream-gridfs.c, line: 114
"timeout_msec <= 2147483647" is always true regardless of the values of its operands. This occurs as the logical operand of "!".

       BSON_ASSERT (timeout_msec <= INT_MAX);



 Comments   
Comment by Githook User [ 09/May/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2134 warning in gridfs stream code
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/46b4962d0b7792bb806460bd75e7eb67e8d62cf7

Generated at Wed Feb 07 21:14:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.