⬢ DragonFlyBSD Kernel Audit
DF-5747 / fix.diff
← back to finding ↓ download raw
--- a/sys/netbt/rfcomm_upper.c
+++ b/sys/netbt/rfcomm_upper.c
@@ -104,6 +104,9 @@
 rfcomm_bind(struct rfcomm_dlc *dlc, struct sockaddr_bt *addr)
 {
 
+	if (dlc->rd_state != RFCOMM_DLC_CLOSED)
+		return EINVAL;
+
 	memcpy(&dlc->rd_laddr, addr, sizeof(struct sockaddr_bt));
 	return 0;
 }