DragonFlyBSD Kernel Audit
DF-0415 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1641,7 +1641,9 @@
 				break;
 			case TCP_KEEPINTVL:
 				tp->t_keepintvl = opthz;
-				tp->t_maxidle = tp->t_keepintvl * tp->t_keepcnt;
+				tp->t_maxidle = (int)(((int64_t)tp->t_keepintvl *
+				    tp->t_keepcnt > INT_MAX) ? INT_MAX :
+				    (int64_t)tp->t_keepintvl * tp->t_keepcnt);
 				break;
 			}
 			break;