[CDRIVER-2852] Coverity analysis defect 105068: Unchecked return value Created: 11/Oct/18  Updated: 28/Oct/23  Resolved: 23/Oct/18

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

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


 Description   

Value returned from a function is not checked for errors before being used

Defect 105068 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/libmongoc/src/mongoc/mongoc-gridfs-bucket.c
Function mongoc_gridfs_bucket_open_download_stream
/src/libmongoc/src/mongoc/mongoc-gridfs-bucket.c, line: 382
Calling "bson_iter_init" without checking return value (as is done elsewhere 144 out of 177 times).

       bson_iter_init (&iter, &file_doc);



 Comments   
Comment by Githook User [ 23/Oct/18 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: CDRIVER-2852 check return value of iter_init
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/6bc98c591df3ca68195bd2f7359d6e6b27cfac96

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