At least 3 locations in the current codebase (including 0.10) use constructs like:
VerifyScript(scriptSig, prevPubKey, flags, SignatureChecker(CMutableTransaction, i))
However, this causes an implicit copy of the CMutableTransaction to a temporary CTransaction, which SignatureChecker then saves a reference to. When the constructor completes, (at least within defined behaviour) the temporary is deleted and the SignatureChecker (if used) will still access it by reference.
At least GCC 4.8 does not warn about this, and silently compiles it. I have seen a "random" crash as a result (in modified code), but cannot systematically reproduce it.
Proposed solutions:
Make CMutableTransaction a subclass of CTransaction. This means making GetHash a virtual, which harms performance in hot code (NACK).
Make an alternative VerifyScript construct the SignatureChecker. This means it is once again aware of the SignatureChecker constructor parameters (NACK).
Make SignatureChecker a template class able to work on either CTransaction or CMutableTransaction. This puts templates into consensus code (NACK).
Make a separate MutableSignatureChecker class for CMutableTransactions. No known issues with this approach. (this seems okay)
Make SignatureChecker store a copy of the CTransaction it is constructed with. This may have performance hits in hot code (NACK?).
Besides fixing this, it should be made harder to accidentally trigger this behaviour by making SignatureChecker reject CMutableTransaction. This can be done by making a private constructor with CMutableTransaction, or by disallowing implicit conversions from CMutableTransaction to CTransaction.