Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content by Label
showLabelsfalse
maxResults99
label+str,+rule,-void
showSpacefalse
sorttitle
space@self
cqllabel = "rule" and label = "str" and label != "void" and space = currentSpace()

Info

Information for Editors
In order to have a new guideline automatically listed above be sure to label it str and rule.

Risk Assessment Summary

Rule

Severity

Likelihood

Detectable

Repairable

Priority

Level

STR30-CLowLikelyNoYes

P6

L2

STR31-CHighLikelyNoNo

P9

L2

STR32-CHighProbableNoYes

P12

L1

STR34-CMediumProbableYesNo

P8

L2

STR37-CLowUnlikelyYesYes

P3

L3

STR38-CHighLikelyYesNo

P18

L1

Related Rules and Recommendations

Navigation Map
char-strings
char-strings
cellWidth700
wrapAfter1
cellHeight15

...

Image Added Image Added Image Added

Strings are a fundamental concept in software engineering, but they are not a built-in type in C.  A string is a contiguous sequence of characters terminated by and including the first null. character. The C programming language supports the following types of strings:  single byte character strings, multibyte character strings, and wide character strings. Single byte and multibyte character strings are both described as null-terminated byte strings.  

Null-terminated byte strings consist of a contiguous sequence of characters terminated by and including the first null character. A pointer to a null-terminated byte string points to its initial character. The length of a string is the number of bytes preceding the null character, and the value of a string is the sequence of the values of the contained characters, in order.

A wide string is a contiguous sequence of wide characters terminated by and including the first null wide character. A pointer to a wide string points to its initial (lowest addressed) wide character. The length of a wide string is the number of wide characters preceding the null wide character and the value of a wide string is the sequence of code values of the contained wide characters, in order.

Recommendations

STR00-C. Use TR 24731 for remediation of existing string manipulation code

STR01-C. Use managed strings for development of new string manipulation code

Rules

STR30-C. Do not attempt to modify string literals

STR31-C. Do not assume bounded input

STR32-C. Allocated adequate space when copying bounded strings

Guarantee that all strings are null-terminated