[SERVER-10398] DiskLoc56Bit::Z accesses bytes not owned by current DiskLoc56Bit object Created: 01/Aug/13  Updated: 11/Jul/16  Resolved: 01/Aug/13

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

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

In https://github.com/mongodb/mongo/blob/57213bdd0d1abf214f4a7db3f6e4aa161a69a9c5/src/mongo/db/btree.h#L194

DiskLoc56Bit::Z does an 8 byte read from a reinterpret_cast'ed this pointer. However, a DiskLoc56Bit is only 7 bytes long, so this is undefined behavior.

The 'Z' method should be rewritten to only access the bytes owned by the current DiskLoc56Bit.



 Comments   
Comment by auto [ 01/Aug/13 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-10398 Avoid reading unowned byte in DiskLoc56Bit::Z
Branch: master
https://github.com/mongodb/mongo/commit/c5fcc5d71623bccc52df70c010685c2743e98d9a

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