Implement token _new_from_buffer_copy

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.13.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, the `_new_from_buffer` function in `mc-tokens.c` calls `_mongocrypt_buffer_set_to` which shallow copies the data pointer. This presents an issue if the src buffer gets deleted later in the program (data pointer on dst buffer will be stale).

      Creating a new function that instead calls `_mongocrypt_buffer_copy_to` instead will deep copy the src buffer, preventing this issue.

      This behavior was exposed while refactoring FLETokens in the server to wrap around the token implementation in libmongocrypt.

              Assignee:
              Josh Siegel
              Reporter:
              Josh Siegel
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: