[SERVER-68105] Coverity analysis defect 122576: Out-of-bounds access Created: 17/Jul/22  Updated: 27/Oct/23  Resolved: 23/Aug/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Gregory Wlodarek
Resolution: Works as Designed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Execution Team 2022-09-05
Participants:

 Description   

Out-of-bounds access

Access of memory not owned by this buffer may cause crashes or incorrect computations. Out-of-bounds access to a buffer



 Comments   
Comment by Gregory Wlodarek [ 23/Aug/22 ]

Looks like an incorrect analysis by Coverity. We're just making a copy of catalogId in the lambda, then using it for a map lookup, like everywhere else.

Comment by Gregory Wlodarek [ 23/Aug/22 ]

https://github.com/mongodb/mongo/blob/f44c2325605147a5f096fec22626c5fa6ababe51/src/mongo/db/storage/durable_catalog_impl.cpp#L469

CID 122576 (#1 of 1): Out-of-bounds access (OVERRUN)
1. overrun-buffer-val: Overrunning buffer pointed to by catalogId of 8 bytes by passing it to a function which accesses it at byte offset 31.

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