Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-560

_fle2_insert_encryptionInformation raises Valgrind errors on bson_t

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Unknown Unknown
    • 1.8.0
    • None
    • None
    • None
    • Not Needed

    Description

      In _fle2_insert_encryptionInformation in mongocrypt-ctx-encrypt.c, a Valgrind memory leak can occur when the libbson BSON_MEMCHECK compile flag is set because:

      1. bson_t explain is initialized on line 222 (as of commit 073a95) but is then passed as the dst argument to bson_copy_to on line 275 which requires that dst be uninitialized to avoid leaking memory (documentation)
      2. bson_t out is initialized on line 221, but if the goto success statement on line 246 is hit, then out never gets bson_destroy-ed before the function exits

      Attachments

        Activity

          People

            kyle.kloberdanz@mongodb.com Kyle Kloberdanz
            zachary.espiritu@mongodb.com Zachary Espiritu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: