aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-04 23:55:42 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-04 23:55:42 +0000
commitc8833a529e7e0bdc0e49eb82182348fc74e1c41e (patch)
treea030295809874635bf3d384103cad253ec5d8f43
parenta752cc41c17583e07c59d285b1cda468f445b7c7 (diff)
Merged revisions 261095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r261095 | tilghman | 2010-05-04 18:51:52 -0500 (Tue, 04 May 2010) | 18 lines Merged revisions 261093-261094 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r261093 | tilghman | 2010-05-04 18:36:53 -0500 (Tue, 04 May 2010) | 7 lines Protect against overflow, when calculating how long to wait for a frame. (closes issue #17128) Reported by: under Patches: d.diff uploaded by under (license 914) ........ r261094 | tilghman | 2010-05-04 18:47:08 -0500 (Tue, 04 May 2010) | 2 lines Add a tiny corner case to the previous commit ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@261096 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index 59b547e75..a8d9be8cc 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2078,10 +2078,15 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds,
}
/* Wait full interval */
rms = *ms;
- if (whentohangup) {
+ /* INT_MAX, not LONG_MAX, because it matters on 64-bit */
+ if (whentohangup && whentohangup < INT_MAX / 1000) {
rms = whentohangup * 1000; /* timeout in milliseconds */
- if (*ms >= 0 && *ms < rms) /* original *ms still smaller */
+ 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,