summaryrefslogtreecommitdiff
path: root/net/asterisk/files/patch-AST-2016-002
blob: 75ca85aeacf8cc154def45b7c3de74dc357e7719 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5de304a..277eec7 100644
--- channels/chan_sip.c
+++ channels/chan_sip.c
@@ -3771,6 +3771,13 @@ static int retrans_pkt(const void *data)
 			}
 
 			/* For non-invites, a maximum of 4 secs */
+			if (INT_MAX / pkt->timer_a < pkt->timer_t1) {
+				/*
+				 * Uh Oh, we will have an integer overflow.
+				 * Recalculate previous timeout time instead.
+				 */
+				pkt->timer_a = pkt->timer_a / 2;
+			}
 			siptimer_a = pkt->timer_t1 * pkt->timer_a;	/* Double each time */
 			if (pkt->method != SIP_INVITE && siptimer_a > 4000) {
 				siptimer_a = 4000;