1508
Scope Impact Likelihood
Other Quality Degradation
Detection Methods
Other
While this weakness might be caught by the compiler in some languages, it can occur more
frequently in cases in which the called function accepts variable numbers of arguments, such
as format strings in C. It also can occur in languages or environments that do not require that
functions always be called with the correct number of arguments, such as Perl.
Potential Mitigations
Phase: Testing
Because this function call often produces incorrect behavior it will usually be detected during
testing or normal operation of the product. During testing exercise all possible control paths will
typically expose this weakness except in rare cases when the incorrect function call accidentally
produces the correct results or if the provided argument type is very similar to the expected
argument type.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 998 SFP Secondary Cluster: Glitch in Computation 888 2419
MemberOf 1157 SEI CERT C Coding Standard - Guidelines 03.
Expressions (EXP)
1154 2455
MemberOf 1163 SEI CERT C Coding Standard - Guidelines 09. Input
Output (FIO)
1154 2459
MemberOf 1412 Comprehensive Categorization: Poor Coding Practices 1400 2538
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
Software Fault Patterns SFP1 Glitch in computation
CERT C Secure Coding EXP37-C CWE More Specific Call functions with the correct number
and type of arguments
CERT C Secure Coding FIO47-C Imprecise Use valid format strings
CWE-686: Function Call With Incorrect Argument Type
Weakness ID : 686
Structure : Simple
Abstraction : Variant
Description
The product calls a function, procedure, or routine, but the caller specifies an argument that is the
wrong data type, which may lead to resultant weaknesses.
Extended Description
This weakness is most likely to occur in loosely typed languages, or in strongly typed languages
in which the types of variable arguments cannot be enforced at compilation time, or where there is
implicit casting.
Relationships
CWE Version 4.14
CWE-686: Function Call With Incorrect Argument Type
CWE-686: Function Call With Incorrect Argument Type