Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
-
latest in git
Description
In gridfs_store_stream, there are unchecked malloc and realloc calls.
if any of those fail with NULL, the following code will dereference NULL,
probably provoking a segfault:
if ( to_write < gfs->chunk_len ) {
if( gfs->pending_data )
else if (to_write > 0)
{ gfs->pending_data = (char *)malloc(to_write); memcpy( gfs->pending_data, data, length ); } gfs->pending_len += length;
} else {
I didn't try to fix it because I suspect the function is incomplete.
Its return type is "bson", yet there is no return statement.
Attachments
Issue Links
- is duplicated by
-
CDRIVER-43 avoid NULL-deref (gridfs_store_stream_init API change)
-
- Closed
-