Characters and Strings (STR)
- STR30-C. Do not attempt to modify string literals
- STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator
- STR32-C. Do not pass a non-null-terminated character sequence to a library function that expects a string
- STR34-C. Cast characters to unsigned char before converting to larger integer sizes
- STR37-C. Arguments to character-handling functions must be representable as an unsigned char
- STR38-C. Do not confuse narrow and wide character strings and functions
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-C | Low | Likely | No | Yes | P6 | L2 |
| STR31-C | High | Likely | No | No | P9 | L2 |
| STR32-C | High | Probable | No | Yes | P12 | L1 |
| STR34-C | Medium | Probable | Yes | No | P8 | L2 |
| STR37-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| STR38-C | High | Likely | Yes | No | P18 | L1 |


