[CSHARP-1289] Fix 32 bit integer overflows in ByteBufferStream and MultiChunkBuffer Created: 21/May/15  Updated: 20/Jan/16  Resolved: 25/Jun/15

Status: Closed
Project: C# Driver
Component/s: BSON
Affects Version/s: 2.0
Fix Version/s: 2.1

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The current implementations of ByteBufferStream and MultiChunkBuffer use 32 bit integers for certain fields, which limits them to a maximum size of 2GB (minus 1).

At this point we're not going to change the 2GB limit, but there are certain cases where the current implementation uses 32 bit arithmetic which can result in integer overflow and large values being mis-interpreted as negative numbers, causing odd results.



 Comments   
Comment by Githook User [ 25/Jun/15 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1289: Fix 32 bit integer overflows in ByteBufferStream and MultiChunkBuffer.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/bf9a1800c666e953ecc97f04f62e7531d3999edf

Generated at Wed Feb 07 21:39:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.