Skip to content

Commit 99d723e

Browse files
committed
PHPC-126: Fixed unchecked return
1 parent 148e726 commit 99d723e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

php_phongo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,9 @@ static void phongo_cursor_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{
12401240
/* firstBatch is empty when the query simply didn't return any results */
12411241
if (cursor_it->firstBatch) {
12421242
if (cursor_it->is_command_cursor) {
1243-
bson_iter_init(&cursor_it->first_batch_iter, cursor_it->firstBatch);
1243+
if (!bson_iter_init(&cursor_it->first_batch_iter, cursor_it->firstBatch)) {
1244+
return;
1245+
}
12441246
if (bson_iter_next (&cursor_it->first_batch_iter)) {
12451247
if (BSON_ITER_HOLDS_DOCUMENT (&cursor_it->first_batch_iter)) {
12461248
const uint8_t *data = NULL;

0 commit comments

Comments
 (0)