Skip to content

Commit

Permalink
Don't coredump if a bson object doesn't contain anything.
Browse files Browse the repository at this point in the history
BUGZID:
  • Loading branch information
lehenbauer committed Feb 13, 2014
1 parent 4ae77dd commit cb0340d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generic/bson.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ mongotcl_bsontolist_raw (Tcl_Interp *interp, Tcl_Obj *listObj, const char *data
bson_timestamp_t ts;
char oidhex[25];
bson scope;

if (data == NULL) {
return listObj;
}

bson_iterator_from_buffer(&i, data);

while (bson_iterator_next (&i)) {
Expand Down

0 comments on commit cb0340d

Please sign in to comment.