Skip to content

Commit 51de955

Browse files
authored
CDRIVER-5536 zero-init bson_iter_t::value (#1587)
Intended to address repeated warnings from Coverity. Though leaving `value` uninitialized may be safe, it is also a public struct field.
1 parent 10f68b9 commit 51de955

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libbson/src/bson/bson-iter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ bson_iter_init (bson_iter_t *iter, /* OUT */
6262
iter->d4 = 0;
6363
iter->next_off = 4;
6464
iter->err_off = 0;
65+
iter->value = (bson_value_t){0};
6566

6667
return true;
6768
}

0 commit comments

Comments
 (0)