From: Patryk Kaczmarek <patryk.k@samsung.com>

Subject: [E-devel] [Patch] [Ecore] Protection for giving below zero
values for ecore_poll and ecore_timer

Please also check attached patch for ecore_timer_interval_set and
ecore_poller_poll_interval_set.

It checks if given time is not zero or below zero.



SVN revision: 76805
This commit is contained in:
Patryk Kaczmarek 2012-09-18 11:38:08 +00:00 committed by Carsten Haitzler
parent 042ecacd0f
commit cc72c09b84
2 changed files with 13 additions and 0 deletions

View File

@ -194,6 +194,13 @@ ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
double poll_time)
{
EINA_MAIN_LOOP_CHECK_RETURN;
if (poll_time < 0.0)
{
ERR("Poll time %f less than zero, ignored", poll_time);
return;
}
poll_interval = poll_time;
_ecore_poller_next_tick_eval();
}

View File

@ -233,6 +233,12 @@ ecore_timer_interval_set(Ecore_Timer *timer,
EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (in < 0.0)
{
ERR("Interval %f less than zero, ignored", in);
goto unlock;
}
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,