Some environments provide environment pointers that are valid when main()
is called, but may be invalided by operations that modify the environment.
Section J.5.1 of the C standard Standard [ISO/IEC 9899:2011] states:
...
The environment block passed to
main
andwmain
is a "frozen" copy of the current environment. If you subsequently change the environment via a call to_putenv
or_wputenv
, the current environment (as returned bygetenv
/_wgetenv
and the_environ
/_wenviron
variable) will change, but the block pointed to byenvp
will not change.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...
Bibliography
...
] | Section J.5.1, "Environment |
...
Arguments" |
...
...
...
...