---
title: "CWE-685: Function Call With Incorrect Number of Arguments"
url: https://radicalnotion.ai/cwe/cwe-685
type: cwe
description: "The product calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-685: Function Call With Incorrect Number of Arguments

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 0
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | This problem typically occurs when the programmer makes a typo, or copy and paste errors. |

## Applicable platforms

**Languages:** C (Undetermined), Perl (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Quality Degradation | - |

## Potential mitigations

### 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.

## 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.

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-628](https://radicalnotion.ai/cwe/cwe-628) | Function Call with Incorrectly Specified Arguments |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Glitch in computation | SFP1 | - |
| CERT C Secure Coding | Call functions with the correct number and type of arguments | EXP37-C | CWE More Specific |
| CERT C Secure Coding | Use valid format strings | FIO47-C | Imprecise |

## Frequently asked questions

### What is CWE-685?

The product calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses.

### How do you prevent CWE-685?

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.

### How is CWE-685 detected?

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.

### What are the consequences of CWE-685?

Exploiting CWE-685 can lead to: Quality Degradation.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/685.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-685). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
