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

mongocrypt_status_set requires null byte to be included in message_len

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None

      mongocrypt_status_set requires null byte to be included in message_len, eg in Python this code prints '12' instead of '123':

      msg = b"123"
      lib.mongocrypt_status_set(
          status, lib.MONGOCRYPT_STATUS_ERROR_CLIENT, 1, msg, len(msg) + 1)
      msg2 = _to_string(lib.mongocrypt_status_message(status, ffi.NULL))
      print(msg2)
      

      Other libmongocrypt functions (like mongocrypt_ctx_setopt_masterkey_aws) don't need the +1 for the null byte so I consider this a bug.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: