From 1f4e41d2acf73895e0db2eaa6f011ec663d16d20 Mon Sep 17 00:00:00 2001 From: yangfeng Date: Sun, 28 Sep 2025 17:50:48 +0800 Subject: [PATCH] fix(bt/bluedroid): Fix the boundary conditions when checking EIR data --- components/bt/host/bluedroid/stack/btm/btm_inq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/stack/btm/btm_inq.c b/components/bt/host/bluedroid/stack/btm/btm_inq.c index ed84167982..4456140df9 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_inq.c +++ b/components/bt/host/bluedroid/stack/btm/btm_inq.c @@ -2450,7 +2450,7 @@ UINT8 *BTM_CheckEirData( UINT8 *p_eir, UINT8 type, UINT8 *p_length ) /* Break loop if eir data is in an incorrect format, as it may lead to memory overflow */ - if ( p >= p_eir + HCI_EXT_INQ_RESPONSE_LEN ) { + if ( p >= p_eir + HCI_EXT_INQ_RESPONSE_LEN - 1 ) { break; }