summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-12 12:50:26 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-12 18:05:10 +0100
commiteaa06230ddf53a444e37e66034b0e4f8f4b2b0af (patch)
treec97e030be1c5089b2afd71c5a7228fb30e083b6d
parent765c5c2a0b2c28c4b8497b28ffbd64f159a446d6 (diff)
efl: check config values before passing to non-null function
if these config values don't exist, we should return the inlined defaults Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11499
-rw-r--r--src/lib/efl/Efl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 81e274883b..ec6f168a8b 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -253,7 +253,7 @@ efl_config_bool_get(const Efl_Config *obj, const char * name)
253{ 253{
254 Eina_Value *v = efl_config_get(obj, name); 254 Eina_Value *v = efl_config_get(obj, name);
255 Eina_Bool b = 0; 255 Eina_Bool b = 0;
256 if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR) 256 if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR)
257 eina_value_get(v, &b); 257 eina_value_get(v, &b);
258 eina_value_free(v); 258 eina_value_free(v);
259 return b; 259 return b;
@@ -275,7 +275,7 @@ efl_config_int_get(const Efl_Config *obj, const char * name)
275{ 275{
276 Eina_Value *v = efl_config_get(obj, name); 276 Eina_Value *v = efl_config_get(obj, name);
277 int b = 0; 277 int b = 0;
278 if (eina_value_type_get(v) == EINA_VALUE_TYPE_INT) 278 if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_INT)
279 eina_value_get(v, &b); 279 eina_value_get(v, &b);
280 eina_value_free(v); 280 eina_value_free(v);
281 return b; 281 return b;
@@ -297,7 +297,7 @@ efl_config_double_get(const Efl_Config *obj, const char * name)
297{ 297{
298 Eina_Value *v = efl_config_get(obj, name); 298 Eina_Value *v = efl_config_get(obj, name);
299 double b = 0; 299 double b = 0;
300 if (eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE) 300 if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE)
301 eina_value_get(v, &b); 301 eina_value_get(v, &b);
302 eina_value_free(v); 302 eina_value_free(v);
303 return b; 303 return b;
@@ -319,7 +319,7 @@ efl_config_string_get(const Efl_Config *obj, const char *name)
319{ 319{
320 Eina_Value *v = efl_config_get(obj, name); 320 Eina_Value *v = efl_config_get(obj, name);
321 Eina_Stringshare *s = 0; 321 Eina_Stringshare *s = 0;
322 if (eina_value_type_get(v) == EINA_VALUE_TYPE_STRING) 322 if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_STRING)
323 { 323 {
324 const char *b = 0; 324 const char *b = 0;
325 eina_value_get(v, &b); 325 eina_value_get(v, &b);