kernel/heap: Avoid heap corruption on invalid Parameter in GlobalFree(), with Test

Dmitry Timoshkov dmitry at codeweavers.com
Sun Mar 19 08:28:19 CST 2006


"Detlef Riekenberg" <wine.dev at web.de> wrote:

> --- a/dlls/kernel/tests/heap.c
> +++ b/dlls/kernel/tests/heap.c
> @@ -25,6 +25,8 @@
> #include "winbase.h"
> #include "wine/test.h"
> 
> +#define MAGIC_DEAD 0x00dead00

> +    SetLastError(MAGIC_DEAD);
> +    hsecond = GlobalFree(gbl);      /* invalid handle: free memory twice */

There is no need to invent a new magic number, a usual convenience for
Wine tests is to use 0xdeadbeef.

-- 
Dmitry.



More information about the wine-devel mailing list