Update cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.qhelp

Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
This commit is contained in:
Mathias Vorreiter Pedersen
2024-05-01 11:41:16 +01:00
committed by GitHub
parent 708d12624f
commit 22e843abc6

View File

@@ -31,7 +31,7 @@ This is because the temporary container is not bound to a rvalue reference.
<sample src="IteratorToExpiredContainerExtendedLifetime.cpp" />
<p>
To fix <code>lifetime_of_temp_not_extended</code> consider rewriting the code so that the temporary's lifetime is extended.
To fix <code>lifetime_of_temp_not_extended</code>, consider rewriting the code so that the lifetime of the temporary object is extended.
In <code>fixed_lifetime_of_temp_not_extended</code> the lifetime of the temporary object has been extended by storing it in an rvalue reference.
</p>
<sample src="IteratorToExpiredContainerExtendedLifetime-fixed.cpp" />