summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCNSS_WLAN Service <cnssbldsw@qualcomm.com>2023-03-27 00:02:56 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2023-03-27 00:02:56 -0700
commit08cf493e27e9e8251f3d616a19ef14d704317456 (patch)
treee25d0d3deac34285efb69e54fc14b8634b91a661
parent0fc31c7e1929c5a15dcb611d82e174416558c171 (diff)
parent5d9cbb4176b0861d53aaca36d35f7d9716e12657 (diff)
Merge "BT: Fixing the rfc_slot_id overflow" into bt-sys.lnx.13.0
-rw-r--r--btif/src/btif_sock_rfc.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/btif/src/btif_sock_rfc.cc b/btif/src/btif_sock_rfc.cc
index a4ad07349..748c1723c 100644
--- a/btif/src/btif_sock_rfc.cc
+++ b/btif/src/btif_sock_rfc.cc
@@ -215,7 +215,11 @@ static rfc_slot_t* alloc_rfc_slot(const RawAddress* addr, const char* name,
}
// Increment slot id and make sure we don't use id=0.
- if (++rfc_slot_id == 0) rfc_slot_id = 1;
+ if (UINT32_MAX == rfc_slot_id) {
+ rfc_slot_id = 1;
+ } else {
+ ++rfc_slot_id;
+ }
slot->fd = fds[0];
slot->app_fd = fds[1];