[SERVER-18711] Coverity analysis defect 72710: Unchecked return value Created: 28/May/15  Updated: 14/Apr/16  Resolved: 09/Jun/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: Daniel Alabi
Resolution: Won't Fix Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

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

Defect 72710 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/mongo/db/commands/user_management_commands.cpp
Function mongo::<unnamed>::updateAuthzDocuments(mongo::OperationContext *, const mongo::NamespaceString &, const mongo::BSONObj &, const mongo::BSONObj &, bool, bool, const mongo::BSONObj &, int *)
/src/mongo/db/commands/user_management_commands.cpp, line: 314
Calling "runCommand" without checking return value (as is done elsewhere 75 out of 104 times).

                client.runCommand("admin", gleBuilder.done(), res);



 Comments   
Comment by Daniel Alabi [ 03/Jun/15 ]

We use DBClientCommands::getLastErrorString to check the return value of DBClientCommands::runCommand.

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