String format specifier causes buffer argument of standard library functions to overflow
This defect occurs when the format specifier argument
for functions such as sscanf leads to an overflow
or underflow in the memory buffer argument.
If the format specifier specifies a precision that is greater than the memory buffer size, an overflow occurs. Overflows can cause unexpected behavior such as memory corruption.
Use a format specifier that is compatible with the memory buffer size.
| Group: Static memory |
| Language: C | C++ |
| Default: On for handwritten code, off for generated code |
Command-Line Syntax: STR_FORMAT_BUFFER_OVERFLOW |
| Impact: High |
| CWE ID: 124, 125, 126, 127 |