[SERVER-20497] Coverity analysis defect 73708: Dereference null return value Created: 18/Sep/15  Updated: 21/Sep/15  Resolved: 21/Sep/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

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

Issue Links:
Related
is related to SERVER-20507 Make Database class iterable yielding... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Quint 9 09/18/15
Participants:

 Description   

Return value of function which returns null is dereferenced without checking

Defect 73708 (STATIC_C)
Checker NULL_RETURNS (subcategory none)
File: /src/mongo/db/repair_database.cpp
Function mongo::repairDatabase(mongo::OperationContext *, mongo::StorageEngine *, const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool, bool)::[lambda() (instance 1)]::operator ()() const
/src/mongo/db/repair_database.cpp, line: 227
Assigning: "collection" = null return value from "getCollection".

                    auto collection = db->getCollection(collectionName);



 Comments   
Comment by Mathias Stearn [ 21/Sep/15 ]

This code was replaced with the changes for SERVER-20507 which was designed to be immune to this problem.

Generated at Thu Feb 08 03:54:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.