elementary - fixed some logic errors patched by rajeev.r@samsung.com
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 23 Sep 2011 00:02:13 +0000 (00:02 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 23 Sep 2011 00:02:13 +0000 (00:02 +0000)
commit0f734810a3a2fb9f56af49367128d6c68f4de101
tree8b45ec7f51f53618ed4ef8905803c73197dc1640
parent586efaf247a97d962fdd489c98968a884744183e
elementary - fixed some logic errors patched by rajeev.r@samsung.com

Hi all,
I found few memory related issues in elementary package when performed static analysis on it.

These issues include:
Array indices getting out of bounds, freed memory address being passed to a function as parameter, memory not getting cleaned up because of earlier return statement.

Issues details:
1. In elm_widget.c inside function elm_widget_signal_callback_del(), it is possible that freed memory address esd is passed to the sd->callback_del_func(). I think it should be data, not esd.
Moreover what if the callback frees memory for data, then the other problem is that the return value is data from the function elm_widget_signal_callback_del() which in my opinion can be a problem.

2. Inside directory src/edje_externals for files elm_genlist.c, elm_notify.c, elm_list.c, elm_thumb.c and elm_map.c, array indices can go beyound bounary.
sizeof() operator for an array of character pointers will return [number of elements in the array * size of (char*)], basically 4 times the number of elements which has been taken care in assertion inside src/edje_extenarnals
while performing assertion but has been missed in the next statement in the loop condition.

3. In file src/lib/elm_config.c inside function _elm_config_profiles_list, freeing of file iterator has been missed out.

Please review the attached patch and let me know your opinion.

Thanks.
Regards,
Rajeev

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@63550 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
src/edje_externals/elm_genlist.c
src/edje_externals/elm_list.c
src/edje_externals/elm_map.c
src/edje_externals/elm_notify.c
src/edje_externals/elm_photocam.c
src/edje_externals/elm_thumb.c
src/lib/elm_config.c
src/lib/elm_widget.c