BaseIncomplete

CWE-1045Parent Class with a Virtual Destructor and a Child Class without a Virtual Destructor

Category: other

Description

A parent class has a virtual destructor method, but the parent has a child class that does not have a virtual destructor.

Common consequences· 1

  • Other — Reduce Reliability
    This issue can prevent the product from running reliably, since the child might not perform essential destruction operations. If the relevant code is reachable by an attacker, then this reliability problem might introduce a vulnerability, such as a memory leak (CWE-401).

References

  1. https://cwe.mitre.org/data/definitions/1045.html

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Parent Class without Virtual Destructor Method
CWE
Class with Virtual Method without a Virtual Destructor
CWE
Parent Class with References to Child Class
CWE
Class with Excessively Deep Inheritance
CWE
Class with Excessive Number of Child Classes
CWE
Class Instance Self Destruction Control Element
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.