[SERVER-30569] Coverity analysis defect 101928: Arguments in wrong order Created: 08/Aug/17  Updated: 30/Oct/23  Resolved: 09/Aug/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.5.12

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

Issue Links:
Related
is related to SERVER-30302 Add explicit configuration object for... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: TIG 2017-08-21
Participants:

 Description   

The arguments to a function call are provided in the wrong order.

Defect 101928 (STATIC_C)
Checker SWAPPED_ARGUMENTS (subcategory none)
File: /src/mongo/db/repl/idempotency_update_sequence.cpp
Function mongo::UpdateSequenceGenerator::generatePaths(const mongo::UpdateSequenceGeneratorConfig &, const std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)



 Comments   
Comment by May Hoque [ 09/Aug/17 ]

Have a wonderful day!

Comment by Githook User [ 09/Aug/17 ]

Author:

{'username': 'Utagai', 'email': 'may.hoque@mongodb.com', 'name': 'may'}

Message: SERVER-30569 Fix incorrectly swapped document and array probabilities to constructor.
Branch: master
https://github.com/mongodb/mongo/commit/041f96f0d1b8a153f76bd86b3d394961fa09b716

Comment by Max Hirschhorn [ 08/Aug/17 ]

may.hoque, this appears to be real issue; the change to have the document parameters before the array parameters wasn't carried through all of the necessary places. Coverity flagged the construction of this UpdateSequenceGeneratorConfig instance.

CID 101928 (#1 of 1): Arguments in wrong order (SWAPPED_ARGUMENTS)
swapped_arguments: The positions of arguments in the constructor for mongo::UpdateSequenceGeneratorConfig do not match the ordering of the parameters:
config.arrProbability is passed to docProbability_
config.docProbability is passed to arrProbability_

Generated at Thu Feb 08 04:24:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.