[CXX-603] The gridfs api class GridFileBuilder corrupts data. Created: 19/May/15 Updated: 09/Jun/15 Resolved: 19/May/15 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | legacy-1.0.2 |
| Fix Version/s: | legacy-1.0.3 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Charles Galambos | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | Bug, legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
The class mongo::GridFileBuilder, drops data from the stream, corrupting the data stored. Using mongo::GridFileBuilder:appendChunk to append data of arbitrary block sizes drops part of the blocks. The function call _appendChunk( data + size, length - size,false) is used without checking if there is any further data to add to the pending buffer. Attached is a patch to fix the issue. |
| Comments |
| Comment by Githook User [ 19/May/15 ] |
|
Author: {u'username': u'craftit', u'name': u'Charles Galambos', u'email': u'craftit@gmail.com'}Message: and add unit test for gridfs GridFileBuilder to check it handles block boundries correctly Signed-off-by: Andrew Morrow <acm@mongodb.com> |
| Comment by Charles Galambos [ 19/May/15 ] |
|
I've addressed the code review comments, and added a preliminary version of a unit test to detect the original bug. Unfortunately I am having problems getting the unit tests for integration working on my system. |
| Comment by Andrew Morrow (Inactive) [ 19/May/15 ] |
| Comment by Charles Galambos [ 19/May/15 ] |
|
I've forked the code on github, and created a pull request called 'Fix for corruption of data appended to a gridfs with appendChunk #293' |