ntdll/tests: Fix incorrect calculation of context length in test_copy_context().
`(BYTE *)dst_ex - (BYTE *)dst` is the size of the legacy context, but
`dst_ex->All` already contains the legacy context. Therefore,
`context_length` has the legacy context size added *twice*.
This becomes a problem when `context_length` exceeds
`sizeof(src_context_buffer)`. This confuses `check_changes_in_range()`,
causing out-of-bounds read and unpredictable test results.
Showing
Please
register
or
sign in
to comment