summaryrefslogtreecommitdiff
path: root/alarm-manager.c
diff options
context:
space:
mode:
authorInkyun Kil <inkyun.kil@samsung.com>2018-07-17 16:52:30 +0900
committerInkyun Kil <inkyun.kil@samsung.com>2018-07-17 16:52:30 +0900
commit78f1575f6b5447569203cecdf9bcf13a30098bd7 (patch)
tree1e7d75d702d86485c4439f0611d0ed06edcc29af /alarm-manager.c
parent35cae5a1f3762d4c726185b21f4b03accd7dd131 (diff)
downloadalarm-manager-78f1575f6b5447569203cecdf9bcf13a30098bd7.tar.gz
alarm-manager-78f1575f6b5447569203cecdf9bcf13a30098bd7.tar.bz2
alarm-manager-78f1575f6b5447569203cecdf9bcf13a30098bd7.zip
Check if an interval causes StackOverflow
Change-Id: Ia375181cb38e1716109db24321d9e1c853ad899a Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
Diffstat (limited to 'alarm-manager.c')
-rw-r--r--alarm-manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/alarm-manager.c b/alarm-manager.c
index 4d3224f..66e7fd0 100644
--- a/alarm-manager.c
+++ b/alarm-manager.c
@@ -2643,7 +2643,7 @@ static long __get_proper_interval(long interval, int alarm_type)
}
}
- while (maxInterval * 2 <= interval ||
+ while ((maxInterval * 2 <= interval && maxInterval < LONG_MAX / 2) ||
(alarm_type & ALARM_TYPE_INEXACT && maxInterval < MIN_INEXACT_INTERVAL))
maxInterval *= 2;