]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Protect against overflow, when calculating how long to wait for a frame.
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 4 May 2010 23:36:53 +0000 (23:36 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 4 May 2010 23:36:53 +0000 (23:36 +0000)
(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

index c6ba4fd7bbb4bf3cca017e400224eac3614012ee..bdcc08a47d4815373134edbd4e2fda1a731c2788 100644 (file)
@@ -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;