shared_ptr <vector<uint8_t>> check_and_set_SEK(const string &SEK) {

    vector<char> decr_key(BUF_LEN, 0);
    vector<char> errMsg(BUF_LEN, 0);
    int err_status = 0;

    auto encrypted_SEK = make_shared < vector < uint8_t >> (BUF_LEN, 0);

    uint32_t l = 0;

    sgx_status_t status = trustedSetSEK_backup(eid, &err_status, errMsg.data(), encrypted_SEK->data(), &l,
                                               SEK.c_str());

    encrypted_SEK->resize(l);

    HANDLE_TRUSTED_FUNCTION_ERROR(status, err_status, errMsg.data());

    validate_SEK();

    return encrypted_SEK;
}
The software writes data past the end, or before the beginning, of the intended buffer.