Skip to content

Coverity issue 367349: Different smart pointers managing same raw pointer #56926

Open
@targos

Description

@targos

@nodejs/crypto

This may cause a crash, as different smart pointers may try to delete the raw pointer twice.

In node::​crypto::​ManagedX509::​operator =(node::​crypto::​ManagedX509 const &): Same raw pointer is used to initialize or reset two or more different smart pointers.

Image

ManagedX509& ManagedX509::operator=(const ManagedX509& that) {
cert_.reset(that.get());
if (cert_) [[likely]]
X509_up_ref(cert_.get());
return *this;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions