[CDRIVER-919] Coverity analysis defect 67272: Redundant test Created: 08/Oct/15  Updated: 21/Apr/17  Resolved: 14/Oct/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.0-beta0

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


 Description   

Test always evaluates the same

Defect 67272 (STATIC_C)
Checker DEADCODE (subcategory redundant_test)
File: /src/mongoc/mongoc-async-cmd.c
Function _mongoc_async_cmd_phase_send
/src/mongoc/mongoc-async-cmd.c, line: 280
Condition "bytes", taking false branch. Now the value of "bytes" is equal to 0.

       while (bytes) {

/src/mongoc/mongoc-async-cmd.c, line: 273
Condition "bytes < 0L", taking false branch. Now the value of "bytes" is at least 0.

       if (bytes < 0) {

/src/mongoc/mongoc-async-cmd.c, line: 292
At condition "bytes", the value of "bytes" must be equal to 0.

       if (!bytes) {

/src/mongoc/mongoc-async-cmd.c, line: 288
Assigning: "bytes" = "0L".

             bytes = 0;

/src/mongoc/mongoc-async-cmd.c, line: 292
The condition "!bytes" must be true.

       if (!bytes) {



 Comments   
Comment by Githook User [ 14/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-919: Redundant test
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/85b5f3ae8a2def47f1deefcdacf13675721fa825

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