...
Wiki Markup |
---|
These functions truncate strings that exceed the specified limits. Additionally, some functions such as {{strncpy()}} do not guarantee that the resulting string is null-terminated \[[STR33-C|STR33-C. Guarantee that all strings are null-terminated]\]. |
Truncation Unintentional truncation results in a loss of data and, in some cases, leads to software vulnerabilities.
...
Include Page | ||||
---|---|---|---|---|
|
Exception
An exception to this rule applies if the intent of the programmer was to intentionally truncate the null-terminated byte string. To be compliant with this standard, this intent must be clearly stated in comments.
Risk Assessment
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
STR34-C | 1 (low) | 1 (unlikely) | 2 (medium) | P2 | L3 |
References
- ISO/IEC 9899-1999 Section 7.21 String handling <string.h>
- Seacord 05a Chapter 2 Strings
- ISO/IEC TR 24731-2006