DragonFlyBSD Kernel Audit
DF-0681 / fix.diff
← back to finding ↓ download raw
diff --git a/netbt/rfcomm_upper.c b/netbt/rfcomm_upper.c
--- a/netbt/rfcomm_upper.c
+++ b/netbt/rfcomm_upper.c
@@ -547,8 +547,8 @@
 		memset(fc, 0, sizeof(*fc));
 		fc->lmodem = dlc->rd_lmodem;
 		fc->rmodem = dlc->rd_rmodem;
-		fc->tx_cred = max(dlc->rd_txcred, 0xff);
-		fc->rx_cred = max(dlc->rd_rxcred, 0xff);
+		fc->tx_cred = min(dlc->rd_txcred, 0xff);
+		fc->rx_cred = min(dlc->rd_rxcred, 0xff);
 		if (dlc->rd_session
 		    && (dlc->rd_session->rs_flags & RFCOMM_SESSION_CFC))
 			fc->cfc = 1;