From f340d72e913509b090daff2eb948f423359dce21 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 28 Mar 2005 21:51:55 +0000 Subject: [PATCH] * timer.cc (getitimer): Check that ovalue is a valid pointer, not just NULL. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/timer.cc | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6015c4251..631e6d322 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-03-28 Christopher Faylor + + * timer.cc (getitimer): Check that ovalue is a valid pointer, not just + NULL. + 2005-03-28 Christopher Faylor * timer.cc (timer_tracker::settime): Set times to zero when just diff --git a/winsup/cygwin/timer.cc b/winsup/cygwin/timer.cc index 746362779..8815cdc63 100644 --- a/winsup/cygwin/timer.cc +++ b/winsup/cygwin/timer.cc @@ -386,11 +386,8 @@ getitimer (int which, struct itimerval *ovalue) set_errno (EINVAL); return -1; } - if (ovalue == NULL) - { - set_errno (EFAULT); - return -1; - } + if (check_null_invalid_struct_errno (ovalue)) + return -1; struct itimerspec spec_ovalue; int ret = timer_gettime ((timer_t) &ttstart, &spec_ovalue); if (!ret)