Back to CWE list
CWE-588
Attempt to Access Child of a Non-structure Pointer
Variant
Incomplete
Description
Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.
Parent Weaknesses (ChildOf)
Common Consequences
Scope
Integrity
Impact
Modify Memory
Scope
Availability
Impact
DoS: Crash, Exit, or Restart
Potential Mitigations
Requirements
The choice could be made to use a language that is not susceptible to these issues.
Implementation
Review of type casting operations can identify locations where incompatible types are cast.
CVE-2021-3510JSON decoder accesses a C union using an invalid offset to an object
Applicable Platforms
C
C++
Security Training
Train your team to recognize and prevent security threats with our comprehensive security awareness program.
Start TrainingVulnerability Scanning
Discover vulnerabilities in your applications and infrastructure before attackers do.
Scan Now