[svn-commits] tilghman: branch 1.4 r261094 - /branches/1.4/main/channel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 4 18:47:11 CDT 2010


Author: tilghman
Date: Tue May  4 18:47:08 2010
New Revision: 261094

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=261094
Log:
Add a tiny corner case to the previous commit

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/channel.c?view=diff&rev=261094&r1=261093&r2=261094
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Tue May  4 18:47:08 2010
@@ -1791,10 +1791,14 @@
 	}
 	/* 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,




More information about the svn-commits mailing list