CWE
Home > CWE List > CWE- Individual Dictionary Definition (1.0)  
Search by ID:

CWE-685: Function Call With Incorrect Number of Arguments

Individual Definition in a New Window
Function Call With Incorrect Number of Arguments
Status: Draft
Weakness ID: 685 (Weakness Variant)
Description
Summary

The software calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, leading to undefined behavior and resultant weaknesses.

Weakness Ordinalities
Primary (where the weakness exists independent of other weaknesses)
Detection Factors

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

Use the function, procedure, routine as specified.

Other Notes

This issue is most likely to occur in rarely-tested code.

Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness BaseWeakness BaseWeakness Base628Function Call with Incorrectly Specified Arguments
Development Concepts (primary)699
Research Concepts (primary)1000
Applicable Platforms
Languages
C
Perl
Time of Introduction
* Implementation
Content History
Modifications
Eric Dalci. Cigital. 2008-07-01. (External)
updated Potential_Mitigations
CWE Content Team. MITRE. 2008-09-08. (Internal)
updated Applicable_Platforms, Detection_Factors, Relationships, Other_Notes, Weakness_Ordinalities
Page Last Updated: September 10, 2008