 
                            Some functions return a pointer to an object that cannot be modified without causing undefined behavior. These functions include the standard getenv(), setlocale(), localeconv(), and strerror() functions. In such cases, the function call results must be treated as being const qualified.
Subclause 7.22.4.6, paragraph 4, of the C Standard [ISO/IEC 9899:2011] defines getenv() as follows:
...
Similarly, subclause 7.11.1.1 paragraph 1, paragraph 8 [ISO/IEC 9899:2011], defines setlocale() as follows:
The pointer to string returned by the
setlocalefunction is such that a subsequent call with that string value and its associated category will restore that part of the program's locale. The string pointed to shall not be modified by the program, but may be overwritten by a subsequent call to thesetlocalefunction.
 And subclause 7.11.1.2, paragraph 8 [ISO/IEC 9899:2011], defines localeconv() as follows:
...
Finally, subclause 7.24.6.2, paragraph 4 [ISO/IEC 9899:2011], states:
The
strerrorfunction returns a pointer to the string, the contents of which are locale-specific. The array pointed to shall not be modified by the program, but may be overwritten by a subsequent call to thestrerrorfunction.
...
| CERT C++ Secure Coding Standard | ENV30-CPP. Do not modify the string returned by getenv() | 
| ISO/IEC TS 17961 | Modifying the string returned by getenv, localeconv, setlocale, and strerror [libmod] | 
Bibliography
| [IEEE Std 1003.1:2013] | XSH, System Interfaces, getenvXSH, System Interfaces, setlocaleXSH, System Interfaces, localeconv | ||
| [ISO/IEC 9899:2011] | Subclause 7.11.1.1, "The setlocaleFunction"Subclause 7.11.1.2, "The localeconvFunction"Subclause 7.22.4.6, "The getenvFunction"Subclause 7.24.6.2, "The strerrorFunction" | [Open Group 2004] | getenvsetlocale | 
...