OSDN Git Service

* timer.cc (getitimer): Check that ovalue is a valid pointer, not just NULL.
authorcgf <cgf>
Mon, 28 Mar 2005 21:51:54 +0000 (21:51 +0000)
committercgf <cgf>
Mon, 28 Mar 2005 21:51:54 +0000 (21:51 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/timer.cc

index 6015c42..631e6d3 100644 (file)
@@ -1,5 +1,10 @@
 2005-03-28  Christopher Faylor  <cgf@timesys.com>
 
+       * timer.cc (getitimer): Check that ovalue is a valid pointer, not just
+       NULL.
+
+2005-03-28  Christopher Faylor  <cgf@timesys.com>
+
        * timer.cc (timer_tracker::settime): Set times to zero when just
        cancelling a timer.
 
index 7463627..8815cdc 100644 (file)
@@ -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)