From 1534fa41e07283acf83a50e6c2bbc8ca2f71ab97 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 11 Jun 2007 14:34:53 +1000 Subject: - (dtucker) [openbsd-compat/bsd-misc.c] According to the spec the "remainder" argument to nanosleep may be NULL. Currently this never happens in OpenSSH, but check anyway in case this changes or the code gets used elsewhere. --- ChangeLog | 5 ++++- openbsd-compat/bsd-misc.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6905defb0..ee5db5b2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,9 @@ ciphers, since groff has trouble with wide lines; - (djm) [configure.ac umac.c] If platform doesn't provide swap32(3), then fallback to provided bit-swizzing functions + - (dtucker) [openbsd-compat/bsd-misc.c] According to the spec the "remainder" + argument to nanosleep may be NULL. Currently this never happens in OpenSSH, + but check anyway in case this changes or the code gets used elsewhere. 20070605 - (dtucker) OpenBSD CVS Sync @@ -3001,4 +3004,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4685 2007/06/11 04:15:42 djm Exp $ +$Id: ChangeLog,v 1.4686 2007/06/11 04:34:53 dtucker Exp $ diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index bea3144bd..55f100ac0 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -158,7 +158,8 @@ int nanosleep(const struct timespec *req, struct timespec *rem) tremain.tv_sec = 0; tremain.tv_usec = 0; } - TIMEVAL_TO_TIMESPEC(&tremain, rem) + if (rem != NULL) + TIMEVAL_TO_TIMESPEC(&tremain, rem) return(rc); } -- cgit v1.2.3