Skip to content

DtlsTransport mCtx and mSsl fields #1517

@arvidn

Description

@arvidn

The DtlsTransport class is responsible for the ownership of the OpenSSL Context (SSL_CTX*) as well as the SSL* obect. These are allocated in the constructor and freed in the destructor, if they're set.

However, there's currently no protection against a DtlsTransport object being moved, copy constructed, move assigned or copy assigned. Any of these operations would lead to a double free. somce the same SSL_CTX and SSL objects would be freed both when the copied-from object is destructed, but also when the new copy is destructed.

I suggest you add something like this to the header file:

DtlsTransport(DtlsTransport const&) = delete;
DtlsTransport(DtlsTransport&&) = delete;
DtlsTransport& operator=(DtlsTransport const&) = delete;
DtlsTransport& operator=(DtlsTransport&&) = delete;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions