[CXX-1243] Audit GridFS implementation for correct handling of user-provided and server-provided file lengths and chunk sizes Created: 03/Mar/17  Updated: 21/Mar/17  Resolved: 21/Mar/17

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Samuel Rossi (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

From the GridFS spec:

However, drivers MUST be able to handle existing GridFS files where the length and chunkSize fields might have been stored using a different numeric data type.

It appears that the initial GridFS implementation does not correctly handle downloads of files where the "chunkSize" element from the files document is stored as a 64-bit integer.

In addition, the GridFS API should document that users may not specify a chunk size larger than the maximum value for int32_t when uploading files. Currently, the user-provided chunk size value is narrowed to int32_t in the mongocxx::uploader constructor (when sizeof(size_t) is greater than 4 on the user's system). We should audit the rest of the logic surrounding the handling of these values.



 Comments   
Comment by Githook User [ 21/Mar/17 ]

Author:

{u'username': u'saghm', u'name': u'Saghm Rossi', u'email': u'saghmrossi@gmail.com'}

Message: CXX-1243 Audit GridFS implementation for correct handling of user-provided and server-provided file lengths and chunk sizes
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/3bd5869a221eb2ab9a0312589f1a3447f477bb81

Generated at Wed Feb 07 22:01:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.