Skip to content

Commit

Permalink
MONGOCRYPT-625 address Coverity issues (#838)
Browse files Browse the repository at this point in the history
* initialize `op`

To silence the Coverity issue with CID 156409. Though this appears to be OK as-is.

* zero-init `bson_iter_t`

To silence Coverity issue with CID 156391.

* initialize `result_compactionTokens`

To silience Coverity issue with CID 156424.
  • Loading branch information
kevinAlbs authored Jun 18, 2024
1 parent 5e49a13 commit 18cb9e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mc-fle2-rfds.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ bool mc_FLE2RangeFindDriverSpec_parse(mc_FLE2RangeFindDriverSpec_t *spec,
// {$and: [{$gt: ["$age", 5]}, {$lt:["$age", 50]}]}
// Or `in` may be a Match Expression with this form:
// {$and: [{age: {$gt: 5}}, {age: {$lt: 50}} ]}
bson_iter_t and, array;
bson_iter_t and = {0}, array = {0};
bool ok = false;

if (!parse_and(in, &and, status)) {
Expand Down Expand Up @@ -264,7 +264,7 @@ bool mc_FLE2RangeFindDriverSpec_parse(mc_FLE2RangeFindDriverSpec_t *spec,
}
}

operator_value_t op;
operator_value_t op = {0};
switch (arg_type) {
case AGGREGATE_EXPRESSION:
if (!parse_aggregate_expression(in, &doc, &op, status)) {
Expand Down
2 changes: 1 addition & 1 deletion src/mongocrypt-ctx-encrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ static bool _fle2_append_compactionTokens(mongocrypt_t *crypt,
const char *command_name,
bson_t *out,
mongocrypt_status_t *status) {
bson_t result_compactionTokens;
bson_t result_compactionTokens = BSON_INITIALIZER;
bool ret = false;

BSON_ASSERT_PARAM(crypt);
Expand Down

0 comments on commit 18cb9e4

Please sign in to comment.