CWE-686 Function Call With Incorrect Argument Type
Passing the wrong data type to a function is most common in loosely typed languages and with implicit casts. Here is what CWE-686 means and how to guard against it.
Deep dives, practical guides, and incident analyses from engineers who build Safeguard. No fluff, no vendor FUD — just what you need to ship secure software.
Passing the wrong data type to a function is most common in loosely typed languages and with implicit casts. Here is what CWE-686 means and how to guard against it.
Passing too many or too few arguments leads to undefined behavior, especially in C and Perl. CWE-685 explained with an example and simple checks.
When code does not behave as its documentation says, callers build on a false promise. CWE-684 covers signature checks that say OK when they should not.
Swapping two arguments is easy to do and easy to miss when the types match. CWE-683 shows how it can bypass access checks and how to catch it.
A wrong offset, a wrong width or a wrong comparison can break allocation, permissions and certificate checks. CWE-682 explained, with fixes.
Casting a long to an int or a signed value to unsigned can quietly change the number. CWE-681 is what happens when that wrong number reaches an allocation or a security check.
When a size calculation overflows, malloc hands back a tiny buffer and the next copy runs far past it. Here is how CWE-680 works and how to guard the arithmetic.
Some C and C++ functions are safe only if every caller gets every detail right. CWE-676 covers using them anyway, and how to ban them from your codebase.
Closing a file twice, unlocking twice or decoding twice can corrupt state or bypass filters. See the cases MITRE lists and how to guarantee single use.
Weekly insights on software supply chain security, delivered to your inbox.
Your first fix PR is minutes away.
No sales call required, even your agent can complete the purchase over MCP.