diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-04 23:47:08 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-04 23:47:08 +0000 |
commit | 80ff76bb5d4b141747498f7f0ebbdf70b5c73e42 (patch) | |
tree | f2df532ea5c460ffee7469b4fbd4453befd531ac /main | |
parent | 591be47a263713aabee896291d4ffa90fe5cc6f5 (diff) |
Add a tiny corner case to the previous commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@261094 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index bdcc08a47..eb8906386 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, |