Skip to content

Commit 9ec03f5

Browse files
author
Christian Hergert
committed
cursor: check for failure in _more().
1 parent 881f6d9 commit 9ec03f5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/mongoc/mongoc-cursor.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,12 @@ _mongoc_cursor_more (mongoc_cursor_t *cursor)
842842
{
843843
bson_return_val_if_fail(cursor, false);
844844

845-
return ((!cursor->sent) ||
846-
(cursor->rpc.reply.cursor_id) ||
845+
if (cursor->failed) {
846+
return false;
847+
}
848+
849+
return (!cursor->sent ||
850+
cursor->rpc.reply.cursor_id ||
847851
!cursor->end_of_event);
848852
}
849853

0 commit comments

Comments
 (0)