e_dnd, e_slot: fix misuse of hash function 99/279199/1
authorJunseok Kim <juns.kim@samsung.com>
Tue, 31 May 2022 02:48:36 +0000 (11:48 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 3 Aug 2022 09:10:48 +0000 (18:10 +0900)
e_slot.c: _e_slot_g->hash_slot_objs misuses eina_hash_pointer_new but actual key was int.
e_dnd: _drop_handlers_responsives misuses eina_hash_int32_new but actual key was uintptr_t.
due to pointer size and int size mismatch in 64bit system, these codes can makes some problem.
this patch need for prevent future problem.

please refer: c20f36275df9536520509fe52d9e6faeeaffa67d

Change-Id: I04ad1b28da2fa5cbeff3cb7c3fdcde037f013c9a

src/bin/e_dnd.c
src/bin/e_slot.c

index 26f2717c66b816a9f09a2ec2ea15633278beaf73..360c368497ac3d08c4e04848db041f7a01c75c65 100644 (file)
@@ -128,7 +128,7 @@ e_dnd_init(void)
         _type_text_uri_list = eina_stringshare_add("text/uri-list");
 
         _drop_win_hash = eina_hash_int32_new(NULL);
-        _drop_handlers_responsives = eina_hash_int32_new(NULL);
+        _drop_handlers_responsives = eina_hash_pointer_new(NULL);
 
         E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL);
         E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, NULL);
index bdfb1da5f1d071842ec4cc151fd939adbd9bdf44..f3aeba45e1aff2e3be65016733daafa7ae821b67 100644 (file)
@@ -216,7 +216,7 @@ e_slot_init(void)
 
    EINA_SAFETY_ON_NULL_RETURN(g);
 
-   g->hash_slot_objs = eina_hash_pointer_new(NULL);
+   g->hash_slot_objs = eina_hash_int32_new(NULL);
    g->hash_slot_clients = eina_hash_pointer_new(NULL);
    e_client_layout_cb_set(e_slot_layout_cb);