From: Tilghman Lesher Date: Tue, 4 May 2010 23:47:08 +0000 (+0000) Subject: Add a tiny corner case to the previous commit X-Git-Tag: 1.4.32-rc1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c842507c3e02e8ff09b025f8c4a27086bd7d62b0;p=thirdparty%2Fasterisk.git Add a tiny corner case to the previous commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@261094 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/channel.c b/main/channel.c index bdcc08a47d..eb8906386c 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1791,10 +1791,14 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, } /* Wait full interval */ rms = *ms; - if (whentohangup && whentohangup < LONG_MAX / 1000) { /* Protect against overflow */ + /* INT_MAX, not LONG_MAX, because it matters on 64-bit */ + if (whentohangup && whentohangup < INT_MAX / 1000) { /* Protect against overflow */ rms = whentohangup * 1000; /* timeout in milliseconds */ if (*ms >= 0 && *ms < rms) /* original *ms still smaller */ rms = *ms; + } else if (whentohangup && rms < 0) { + /* Tiny corner case... call would need to last >24 days */ + rms = INT_MAX; } /* * Build the pollfd array, putting the channels' fds first,