mongocrypt_status_set requires null byte to be included in message_len

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: