Skip to content

Commit 278f2d4

Browse files
committed
assert client in mongoc_bulk_operation_set_client
This function should not be used to set the client to NULL and an assertion also guards against a potential segfault when incrementing operation_id.
1 parent aaee18d commit 278f2d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mongoc/mongoc-bulk-operation.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ void
839839
mongoc_bulk_operation_set_client (mongoc_bulk_operation_t *bulk, void *client)
840840
{
841841
BSON_ASSERT (bulk);
842+
BSON_ASSERT (client);
842843

843844
bulk->client = (mongoc_client_t *) client;
844845

0 commit comments

Comments
 (0)