CWE-588: Attempt to Access Child of a Non-structure Pointer

Export to Word

Description

Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.

Extended Description

N/A


ThreatScore

Threat Mapped score: 0.0

Industry: Finiancial

Threat priority: Unclassified


Observed Examples (CVEs)

Related Attack Patterns (CAPEC)

N/A


Attack TTPs

N/A

Modes of Introduction

Phase Note
Implementation N/A

Common Consequences

Potential Mitigations

Applicable Platforms


Demonstrative Examples

Intro: The following example demonstrates the weakness.

struct foo { int i; } ... int main(int argc, char **argv) { *foo = (struct foo *)main; foo->i = 2; return foo->i; }

Notes

← Back to CWE list