From ff122b308bf4ad9115ebfe1d292051c3c5ecbb78 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 12 Mar 2006 04:18:43 +0000 Subject: r14229: Something Coverity hasn't caught (yet) but I've gotten sensitive to null derefs. get_timed_events_timeout() can potentially return NULL. Cope with this. Jeremy. (This used to be commit 04838078723613628b298b7a87622df30432cf64) --- source3/smbd/process.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/smbd/process.c b/source3/smbd/process.c index a50323887a..40d6818f3f 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -445,9 +445,11 @@ static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout) struct timeval tmp; struct timeval *tp = get_timed_events_timeout(&tmp,SMBD_SELECT_TIMEOUT); - to = timeval_min(&to, tp); - if (timeval_is_zero(&to)) { - return True; + if (tp) { + to = timeval_min(&to, tp); + if (timeval_is_zero(&to)) { + return True; + } } } -- cgit v1.2.3