[SERVER-23822] Coverity analysis defect 98550: Unintentional integer overflow Created: 20/Apr/16  Updated: 05/Apr/17  Resolved: 06/Jun/16

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

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

Issue Links:
Depends
depends on SERVER-23733 Remove the mongos chunkSize configura... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 13 (04/22/16), Sharding 14 (05/13/16), Sharding 15 (06/03/16), Sharding 16 (06/24/16)
Participants:

 Description   

An integer overflow occurs, with the result converted to a wider integer type

Defect 98550 (STATIC_C)
Checker OVERFLOW_BEFORE_WIDEN (subcategory none)
File: /src/mongo/s/mongos_options.cpp
Function mongo::storeMongosOptions(const mongo::optionenvironment::Environment &, const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>> &)
/src/mongo/s/mongos_options.cpp, line: 218
Potentially overflowing expression "maxChunkSizeMB * 1024" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t const" (64 bits, unsigned).

            const uint64_t maxChunkSizeBytes = maxChunkSizeMB * 1024 * 1024;



 Comments   
Comment by Kaloian Manassiev [ 06/Jun/16 ]

Commit d900c3b855e66a337ebe6c6f46ab5656d79e1db9 removes this option altogether, so this bug does not apply anymore.

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