Commit c8bc9eb
authored
glib_compat/glib_compact: Clear the buffer in g_hash_table_resize (#2219)
There has a hidden danger in g_hash_table_resize function:
The g_hash_table_resize, it seems to resize the has table, and write the
old value to the new hash table. It seems look for the empty items in
the new_nodes, and if the new_nodes is not be cleared, it maybe naver
found the empty items. So I added a line under the g_new0 function, and
I think clearing new_nodes every time may improve the performance.
Added a memset to clear the new_nodes to fix this problem.
REF: intel/unicorn-for-efi#13
Signed-off-by: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>1 parent 3ad58e1 commit c8bc9eb
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| 719 | + | |
719 | 720 | | |
720 | 721 | | |
721 | 722 | | |
| |||
0 commit comments