CWE
CWE/SANS Top 25 Most Dangerous Software Errors Common Weakness Scoring System
Common Weakness Risk Analysis Framework
Home > CWE List > CWE- Individual Dictionary Definition (2.4)  

CWE-704: Incorrect Type Conversion or Cast

 
Incorrect Type Conversion or Cast
Weakness ID: 704 (Weakness Class)Status: Incomplete
+ Description

Description Summary

The software does not correctly convert an object, resource or structure from one type to a different type.
+ Time of Introduction
  • Architecture and Design
  • Implementation
+ Applicable Platforms

Languages

C: (Often)

C++: (Often)

All

+ Common Consequences
ScopeEffect
Other

Technical Impact: Other

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness ClassWeakness Class664Improper Control of a Resource Through its Lifetime
Development Concepts (primary)699
Research Concepts (primary)1000
ChildOfCategoryCategory737CERT C Secure Coding Section 03 - Expressions (EXP)
Weaknesses Addressed by the CERT C Secure Coding Standard (primary)734
ChildOfCategoryCategory741CERT C Secure Coding Section 07 - Characters and Strings (STR)
Weaknesses Addressed by the CERT C Secure Coding Standard734
ChildOfCategoryCategory747CERT C Secure Coding Section 49 - Miscellaneous (MSC)
Weaknesses Addressed by the CERT C Secure Coding Standard734
ChildOfCategoryCategory875CERT C++ Secure Coding Section 07 - Characters and Strings (STR)
Weaknesses Addressed by the CERT C++ Secure Coding Standard (primary)868
ChildOfCategoryCategory883CERT C++ Secure Coding Section 49 - Miscellaneous (MSC)
Weaknesses Addressed by the CERT C++ Secure Coding Standard868
ChildOfCategoryCategory885SFP Cluster: Risky Values
Software Fault Pattern (SFP) Clusters (primary)888
ParentOfWeakness VariantWeakness Variant588Attempt to Access Child of a Non-structure Pointer
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base681Incorrect Conversion between Numeric Types
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base843Access of Resource Using Incompatible Type ('Type Confusion')
Development Concepts (primary)699
Research Concepts (primary)1000
+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
CERT C Secure CodingEXP05-CDo not cast away a const qualification
CERT C Secure CodingMSC31-CEnsure that return values are compared against the proper type
CERT C Secure CodingSTR34-CCast characters to unsigned types before converting to larger integer sizes
CERT C Secure CodingSTR37-CArguments to character handling functions must be representable as an unsigned char
CERT C++ Secure CodingSTR34-CPPCast characters to unsigned types before converting to larger integer sizes
CERT C++ Secure CodingSTR37-CPPArguments to character handling functions must be representable as an unsigned char
CERT C++ Secure CodingMSC31-CPPEnsure that return values are compared against the proper type
+ Content History
Submissions
Submission DateSubmitterOrganizationSource
2008-09-09MITREInternal CWE Team
Modifications
Modification DateModifierOrganizationSource
2008-07-01Eric DalciCigitalExternal
updated Time_of_Introduction
2008-11-24CWE Content TeamMITREInternal
updated Relationships, Taxonomy_Mappings
2009-05-27CWE Content TeamMITREInternal
updated Description
2011-06-01CWE Content TeamMITREInternal
updated Common_Consequences, Relationships
2011-09-13CWE Content TeamMITREInternal
updated Relationships, Taxonomy_Mappings
2012-05-11CWE Content TeamMITREInternal
updated Relationships
Page Last Updated: February 20, 2013