This The managed string library was and SafeStr libraries were developed in response to the need for a string library that could improve the quality and security of newly developed C language programs while eliminating obstacles to widespread adoption and possible standardization.
...
The managed string library also provides a mechanism for dealing with data sanitization by (optionally) checking that all characters in a string belong to a predefined set of "safe" characters.
Compliant Solution 1
This compliant solution illustrates how the managed string library can be used to create a managed string and retrieve a null-terminated byte string from the managed string.
...
Note that the calls to fprintf()
and printf()
are C99 standard functions and not managed string functions.
Compliant Solution 2
This compliant solution illustrates how the SafeStr library can be used to create and manipulate safe strings.
...
Wiki Markup |
---|
\[[Burch 06|AA. C References#Seacord 06]\]
\[[Messier and Viega 03|http://www.zork.org/safestr/]\] "Safe C String library v1.0.3"
\[[CERT 06|AA. C References#CERT 06]\]
\[[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" |