CWE-135

Incorrect Calculation of Multi-Byte String Length

High

Description

The product does not correctly calculate the length of strings that can contain wide or multi-byte characters.

Potential Impact

How to Fix

Implementation

Always verify the length of the string unit character.

Implementation

Use length computing functions (e.g. strlen, wcslen, etc.) appropriately with their equivalent type (e.g.: byte, wchar_t, etc.)

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-135 vulnerabilities in your codebase.

Get Security Assessment