From 6acbf688e61118d6ee371ede1e6041f0da4c0b9b Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Tue, 4 May 2010 23:36:53 +0000 Subject: [PATCH] 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@261093 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/channel.c b/main/channel.c index c6ba4fd7bb..bdcc08a47d 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1791,7 +1791,7 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, } /* Wait full interval */ rms = *ms; - if (whentohangup) { + if (whentohangup && whentohangup < LONG_MAX / 1000) { /* Protect against overflow */ rms = whentohangup * 1000; /* timeout in milliseconds */ if (*ms >= 0 && *ms < rms) /* original *ms still smaller */ rms = *ms; -- 2.47.2