forked from enlightenment/efl
datetime: Correct the validation of parameter in _field_format_get/_field_limit_get
Because field_list is an array, we should check boundary instead of NULL.
This commit is contained in:
parent
48dc06e1ba
commit
eaedf01afb
|
@ -693,10 +693,11 @@ _field_format_get(Evas_Object *obj,
|
||||||
{
|
{
|
||||||
Datetime_Field *field;
|
Datetime_Field *field;
|
||||||
|
|
||||||
|
if (field_type > ELM_DATETIME_AMPM) return NULL;
|
||||||
|
|
||||||
ELM_DATETIME_DATA_GET(obj, sd);
|
ELM_DATETIME_DATA_GET(obj, sd);
|
||||||
|
|
||||||
field = sd->field_list + field_type;
|
field = sd->field_list + field_type;
|
||||||
if (!field) return NULL;
|
|
||||||
|
|
||||||
return field->fmt;
|
return field->fmt;
|
||||||
}
|
}
|
||||||
|
@ -711,10 +712,11 @@ _field_limit_get(Evas_Object *obj,
|
||||||
Datetime_Field *field;
|
Datetime_Field *field;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
|
|
||||||
|
if (field_type > ELM_DATETIME_AMPM) return;
|
||||||
|
|
||||||
ELM_DATETIME_DATA_GET(obj, sd);
|
ELM_DATETIME_DATA_GET(obj, sd);
|
||||||
|
|
||||||
field = sd->field_list + field_type;
|
field = sd->field_list + field_type;
|
||||||
if (!field) return;
|
|
||||||
|
|
||||||
min = field->min;
|
min = field->min;
|
||||||
max = field->max;
|
max = field->max;
|
||||||
|
|
Loading…
Reference in New Issue