1777
While this weakness is frequently associated with unions when parsing data with many different
embedded object types in C, it can be present in any application that can interpret the same
variable or memory location in multiple ways.
This weakness is not unique to C and C++. For example, errors in PHP applications can be
triggered by providing array parameters when scalars are expected, or vice versa. Languages such
as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it
were another type, can also contain these issues.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 704 Incorrect Type Conversion or Cast 1538
PeerOf 1287 Improper Validation of Specified Type of Input 2138
CanPrecede 119 Improper Restriction of Operations within the Bounds of a
Memory Buffer