Chapter 7. Characters and Strings (STR)

Chapter Contents

Image

Risk Assessment Summary

Image

Image STR30-C. Do not attempt to modify string literals

According to the C Standard, 6.4.5, paragraph 3 [ISO/IEC 9899:2011]:

A character string literal is a sequence of zero or more multibyte characters enclosed in double-quotes, as in "xyz". A UTF−8 string literal is the same, except prefixed by u8. A wide string literal is the same, except prefixed by the letter L,

Get The CERT ® C Coding Standard: 98 Rules for Developing Safe, Reliable, and Secure Systems, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.