Commit d85b700d authored by Francisco Casas's avatar Francisco Casas Committed by Alexandre Julliard

gdi32: Avoid integer overflow in the obj map compare fn.

parent eaa302e6
......@@ -178,7 +178,11 @@ DWORD WINAPI GetObjectType( HGDIOBJ handle )
static int obj_map_cmp( const void *key, const struct wine_rb_entry *entry )
{
struct obj_map_entry *obj_entry = WINE_RB_ENTRY_VALUE( entry, struct obj_map_entry, entry );
return HandleToLong( key ) - HandleToLong( obj_entry->obj );
UINT_PTR a = (UINT_PTR)key;
UINT_PTR b = (UINT_PTR)obj_entry->obj;
if (a > b) return 1;
if (a < b) return -1;
return 0;
};
struct wine_rb_tree obj_map = { obj_map_cmp };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment