diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-05-09 13:28:11 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-05-09 13:28:11 +0000 |
commit | f26e3f1574c14441fd52b9009b0a00d533a88720 (patch) | |
tree | 59a01a30cc213ab7dfe1d10352111afa54c68275 /winsup/cygwin/window.cc | |
parent | 8c63465c7b5d7b8b749757b6d3b1a05ce9d06444 (diff) | |
download | cygnal-f26e3f1574c14441fd52b9009b0a00d533a88720.tar.gz cygnal-f26e3f1574c14441fd52b9009b0a00d533a88720.tar.bz2 cygnal-f26e3f1574c14441fd52b9009b0a00d533a88720.zip |
* window.cc (setitimer): Check for overflow condition
in tv_sec.
Diffstat (limited to 'winsup/cygwin/window.cc')
-rw-r--r-- | winsup/cygwin/window.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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); |