[SERVER-44132] DataBuilder move assignment computes size incorrectly Created: 21/Oct/19  Updated: 29/Oct/23  Resolved: 23/Oct/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.1, 4.2.13, 4.0.24

Type: Bug Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Security 2019-11-04
Participants:

 Description   

In DataBuilder& operator=(DataBuilder&& other), this line computes the start _unwrittenSpaceCursor based on the start of _buf.

        _unwrittenSpaceCursor = {_buf.get(), _buf.get() + other.size()};

This is incorrect as the start of _unwrittenSpaceCursor needs to be offset by size.

This was discovered during the IAM Protocol POC.



 Comments   
Comment by Githook User [ 13/Apr/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-44132 DataBuilder move assignment computes size incorrectly

(cherry picked from commit 4cf93b3802fa90ba02cdeed36b4f6d615b6d6393)
(cherry picked from commit 1beb3391a2006a6daea590abd7585d080a4209f7)
Branch: v4.0
https://github.com/mongodb/mongo/commit/9df1b3a80f39cf7e7ccd6264a207518426a524f6

Comment by Githook User [ 03/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-44132 DataBuilder move assignment computes size incorrectly

(cherry picked from commit 4cf93b3802fa90ba02cdeed36b4f6d615b6d6393)
Branch: v4.2
https://github.com/mongodb/mongo/commit/1beb3391a2006a6daea590abd7585d080a4209f7

Comment by Githook User [ 23/Oct/19 ]

Author:

{'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com', 'name': 'Mark Benvenuto'}

Message: SERVER-44132 DataBuilder move assignment computes size incorrectly
Branch: master
https://github.com/mongodb/mongo/commit/4cf93b3802fa90ba02cdeed36b4f6d615b6d6393

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