[SERVER-75022] Coverity analysis defect 135418: Incorrect sizeof expression Created: 19/Mar/23  Updated: 29/Oct/23  Resolved: 27/Mar/23

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

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

Issue Links:
Problem/Incident
is caused by SERVER-71037 Investigate remaining sort regressions Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2023-04-03
Participants:

 Description   

Incorrect sizeof expression

This is usually caused by a typo or a misunderstanding of the sizeof operator, which should be applied to the actual type whose size is desired. An incorrect sizeof value is used in further computation. The sizeof operator was applied to an unintended variable or expression, such as a pointer variable instead of its target
/src/mongo/db/index/sort_key_generator.h:102: BAD_SIZEOF 135418 Taking the size of "this" is suspicious.



 Comments   
Comment by Githook User [ 27/Mar/23 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@mongodb.com', 'username': 'mtandrei'}

Message: SERVER-75022 Fix calls to sizeof in sort_key_generator.h
Branch: master
https://github.com/mongodb/mongo/commit/98d0d3ce61aa3f8a054069b0f5b16fa51116ea63

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