Skip to content

Commit 90854c7

Browse files
author
Christian Hergert
committed
cluster: check against maximum message size, not max bson size.
1 parent acc886a commit 90854c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mongoc/mongoc-cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2763,7 +2763,7 @@ _mongoc_cluster_try_recv (mongoc_cluster_t *cluster,
27632763
*/
27642764
memcpy (&msg_len, &buffer->data[buffer->off + pos], 4);
27652765
msg_len = BSON_UINT32_FROM_LE (msg_len);
2766-
if ((msg_len < 16) || (msg_len > cluster->max_bson_size)) {
2766+
if ((msg_len < 16) || (msg_len > cluster->max_msg_size)) {
27672767
bson_set_error (error,
27682768
MONGOC_ERROR_PROTOCOL,
27692769
MONGOC_ERROR_PROTOCOL_INVALID_REPLY,

0 commit comments

Comments
 (0)