[SERVER-21121] Coverity analysis defect 76649: Division or modulo by zero Created: 26/Oct/15  Updated: 29/Oct/15  Resolved: 29/Oct/15

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Charlie Swanson
Resolution: Done 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   

Division or modulo by zero results in undefined behavior.

Defect 76649 (STATIC_C)
Checker DIVIDE_BY_ZERO (subcategory none)
File: /src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
Function mongo::BtreeLogic<mongo::BtreeLayoutV1>::getRandomEntry(mongo::OperationContext *) const

File: /src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
Function mongo::BtreeLogic<mongo::BtreeLayoutV0>::getRandomEntry(mongo::OperationContext *) const



 Comments   
Comment by Charlie Swanson [ 29/Oct/15 ]

See comment on the coverity issue. I believe this is a false positive.

Comment by Eric Milkie [ 26/Oct/15 ]

Feel free to mark this as Intentional, as it seems that the code logic prevents nKeysInLevel begin and end from being the same, but it's subtle.

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