summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-12-16 14:10:11 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-12-16 14:10:58 -0800
commit9393560178ade26d2caf579d98962964f5f068d2 (patch)
tree8ea5a072a834e7ce8a2468b42c179615afcf3188 /src/lib/eio
parent2b7a68eb1be1fe4811cf4ed2762475d6328ef385 (diff)
eio: check error case for eina_value_get.
CID 1356609
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_model.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/eio_model.c
index 636022d5bb..1dee3753fd 100644
--- a/src/lib/eio/eio_model.c
+++ b/src/lib/eio/eio_model.c
@@ -403,15 +403,14 @@ _eio_model_efl_model_property_get(Eo *obj, Eio_Model_Data *priv, const char *pro
403 */ 403 */
404static Efl_Future* 404static Efl_Future*
405_eio_model_efl_model_property_set(Eo *obj EINA_UNUSED, 405_eio_model_efl_model_property_set(Eo *obj EINA_UNUSED,
406 Eio_Model_Data *priv, 406 Eio_Model_Data *priv,
407 const char * property, 407 const char * property,
408 const Eina_Value *value) 408 const Eina_Value *value)
409{ 409{
410 char *dest;
411
412 Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); 410 Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
413 Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, loop); 411 Efl_Promise *promise = efl_add(EFL_PROMISE_CLASS, loop);
414 Efl_Future* future = efl_promise_future_get(promise); 412 Efl_Future* future = efl_promise_future_get(promise);
413 char *dest;
415 414
416 EINA_SAFETY_ON_NULL_RETURN_VAL(property, future); 415 EINA_SAFETY_ON_NULL_RETURN_VAL(property, future);
417 416
@@ -421,7 +420,12 @@ _eio_model_efl_model_property_set(Eo *obj EINA_UNUSED,
421 return future; 420 return future;
422 } 421 }
423 422
424 eina_value_get(value, &dest); 423 if (!eina_value_get(value, &dest))
424 {
425 efl_promise_failed_set(promise, EFL_MODEL_ERROR_UNKNOWN);
426 return future;
427 }
428
425 if (priv->path == NULL || !ecore_file_exists(priv->path)) 429 if (priv->path == NULL || !ecore_file_exists(priv->path))
426 { 430 {
427 eina_stringshare_replace(&priv->path, dest); 431 eina_stringshare_replace(&priv->path, dest);