ecore_x: ensure positive malloc size

size_ret is used later as an argument for malloc, so it should be
positive. In addition this should ensure that
ecore_x_window_porp_property_get returns a positive value and is true if
we malloc data.

Hopefully also fixes CID 1135636
This commit is contained in:
Sebastian Dransfeld 2013-12-10 08:50:18 +01:00
parent 3047ec4d91
commit 50569a69c9
1 changed files with 1 additions and 1 deletions

View File

@ -545,7 +545,7 @@ ecore_x_window_prop_property_get(Ecore_X_Window win,
if (_ecore_xlib_sync) ecore_x_sync();
if (ret != Success)
return 0;
if (!num_ret)
if ((!num_ret) || (size_ret <= 0))
{
XFree(prop_ret);
return 0;