diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-05-09 17:28:11 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-05-09 17:28:11 +0400 |
commit | f26e3f1574c14441fd52b9009b0a00d533a88720 (patch) | |
tree | 59a01a30cc213ab7dfe1d10352111afa54c68275 | |
parent | 8c63465c7b5d7b8b749757b6d3b1a05ce9d06444 (diff) |
* window.cc (setitimer): Check for overflow condition
in tv_sec.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/window.cc | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3274a881b..de3429bbe 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Thu May 9 15:24:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by <lha@stacken.kth.se> + * window.cc (setitimer): Check for overflow condition + in tv_sec. + Thu May 9 0:47:00 2000 Corinna Vinschen <corinna@vinschen.de> Patch suggested by Eric Fifer <EFifer@sanwaint.com> diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index 161057426..6651ddc54 100644 --- a/winsup/cygwin/window.cc +++ b/winsup/cygwin/window.cc @@ -13,6 +13,7 @@ details. */ #include <sys/time.h> #include <stdlib.h> #include <errno.h> +#include <limits.h> #include "winsup.h" static NO_COPY UINT timer_active = 0; @@ -154,6 +155,12 @@ setitimer (int which, const struct itimerval *value, struct itimerval *oldvalue) set_errno (EINVAL); return -1; } + /* Check if we will wrap */ + if (itv.it_value.tv_sec >= (long) (UINT_MAX / 1000)) + { + set_errno (EINVAL); + return -1; + } if (timer_active) { KillTimer (gethwnd(), timer_active); |