oleaut32/tests: Get_test_recordinfo shouldn't point into a specific VARIANT.
In many cases (in particular when VariantCopy has been used),
multiple VARIANT structs which contain the same type of record
will share the same instance of IRecordInfo, just adding refcounts.
RecordClear should not be aware of where the data it's clearing came from,
and certainly should not be modifying someone else's VARIANT::brecVal.
This seems to have been intended as a way to make tests more sensitive to
use-after-free, by overwriting the source pointer with NULL after
clearing the pointed-to record.
To preserve that sensitivity (if it was indeed the goal), replace the
hardcoded "0xdeadbeef is valid" check with a "validsrc" address that
get_test_recordinfo initially agrees to pretend points to a valid record,
but will stop accepting after a call to RecordClear.
Showing
Please
register
or
sign in
to comment