[PATCH 1/5] ddraw: Protect against invalid clipper pointers.

Stefan Dösinger stefan at codeweavers.com
Tue Mar 12 03:46:53 CDT 2019



> Am 08.03.2019 um 18:49 schrieb Henri Verbeet <hverbeet at gmail.com>:
> 
> Mostly the fact that impl_from_IDirectDrawClipper() can return NULL,
> yes.
I can easily change that part.

>> The vtable only matters for Release(), the rest of the methods don't care if you change the vtable, that's why I added the magic value.
>> 
> Do applications care though? In principle
> impl_from_IDirectDrawClipper() doesn't currently check the vtable, but
> in practice passing a clipper with a modified vtable to just about
> anything is going to trigger the assert in
> unsafe_impl_from_IDirectDrawClipper().
Deus Ex doesn't, it only cares that we don't crash when attempting to release an already destroyed clipper. I do not know if there are other applications affected by this, but I don't expect there are many, or we would have seen this issue already.

> I.e., as long as applications
> aren't actually modifying the vtable and still expect things to work,
> I'd probably prefer using the vtable as "magic".
I changed the patches in that regard and adjusted the tests. The tests still document that the vtable shouldn't be used to detect valid clippers, but are marked todo.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190312/ce18973c/attachment-0001.sig>


More information about the wine-devel mailing list