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

Implement token _new_from_buffer_copy

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.13.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Josh Siegel
            Reporter:
            josh.siegel@mongodb.com Josh Siegel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: