From e53bf9f6cc8f0de52cc4e2cf836985041130d5ec Mon Sep 17 00:00:00 2001 From: yulincoder <784773435@qq.com> Date: Sat, 14 Jul 2018 11:01:26 +0800 Subject: [PATCH 1/2] fix an overflow bug, which causes overflow task to execute and all of other task to fail --- tos/lib/timer/VirtualizeTimerC.nc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tos/lib/timer/VirtualizeTimerC.nc b/tos/lib/timer/VirtualizeTimerC.nc index 6f6fc577d7..529b11dee0 100644 --- a/tos/lib/timer/VirtualizeTimerC.nc +++ b/tos/lib/timer/VirtualizeTimerC.nc @@ -105,6 +105,7 @@ implementation runtime cost). */ uint32_t now = call TimerFrom.getNow(); int32_t min_remaining = (1UL << 31) - 1; /* max int32_t */ + int32_t max_int32 = min_remaining; bool min_remaining_isset = FALSE; uint16_t num; @@ -119,6 +120,15 @@ implementation uint32_t elapsed = now - timer->t0; int32_t remaining = timer->dt - elapsed; + /* If the value of timer's destination greater than max int32_t, + then the virtual timer is ignored to avoid the fact that all + of other tasks is hard to get runing time and the battery is + quickly exhausted. And the system may crash.*/ + if(timer->dt > max_int32) { + dbg("Value error", "The timer's destination value is too high\n"); + continue; + } + if (remaining < min_remaining) { min_remaining = remaining; From 0f276fc6d81615b8e2fcbe9b6c13a907decf6211 Mon Sep 17 00:00:00 2001 From: "whitesource-bolt-for-github[bot]" Date: Wed, 13 Mar 2019 07:41:29 +0000 Subject: [PATCH 2/2] Initial WhiteSource configuration file --- .whitesource | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .whitesource diff --git a/.whitesource b/.whitesource new file mode 100644 index 0000000000..f340c5defc --- /dev/null +++ b/.whitesource @@ -0,0 +1,8 @@ +########################################################## +#### WhiteSource Integration configuration file #### +########################################################## + +# Configuration # +#---------------# +ws.repo.scan=true +vulnerable.check.run.conclusion.level=failure