...
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 nullNULL-terminated \[[STR32-C. Null-terminate byte strings as required]\]. |
...
An exception to this rule applies if the intent of the programmer was to intentionally truncate the nullNULL-terminated byte string. To be compliant with this standard, this intent must be clearly stated in comments.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
References
Wiki Markup |
---|
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] Section 7.21, "String handling <string.h>" \[[Seacord 05a|AA. C References#Seacord 05a]\] Chapter 2, "Strings" \[[ISO/IEC TR 24731-2006|AA. C References#ISO/IEC TR 24731-2006]\] |