...
Some compilers generate a warning when a pointer to an automatic variable is returned from a function, as in this example. Compile your code at high warning levels and resolve any warnings. (See guideline recommendation MSC00-C. Compile cleanly at high warning levels.)
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
CERT C++ Secure Coding Standard: DCL30-CPP. Declare objects with appropriate storage durations
...
\[[Coverity 2007|AA. Bibliography#Coverity 07]\]
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 6.2.4, "Storage durations of objects," and Section 7.20.3, "Memory management functions"
\[[ Wiki Markup
ISO/IEC PDTR 24772|AA. Bibliography#ISO/IEC PDTR 24772]\] "DCM Dangling references to stack frames"
MISRA Rule 8.6
Bibliography
Wiki Markup |
---|
\[[MISRACoverity 20042007|AA. Bibliography#MISRABibliography#Coverity 0407]\] Rule 8.6 |
...