Details
-
Bug
-
Resolution: Done
-
Major - P3
-
0.4
-
None
-
None
-
Visual Studio 2005, Windows, release mode compilation
Description
In mongodb-mongo-c-driver-1380839, version 0.4, in the file gridfs.c, line 129 is:
assert( mongo_run_command( gfs->client, gfs->dbname, &command, &res ) == MONGO_OK );
When compiling this code in Visual Studio 2005 (and presumably other compilers), in debug mode the assert is compiled, but in release mode the assert is ignored.
Therefore, in release mode the bson object "res" is not initialized, and when "res" is used on line 141:
bson_find( &it, &res, "md5" );
the code will crash.
Initializing "res" should be done outside the assert.