This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 89e7090c5 controller/ble_ll_sync.c: acad_len potentially uninitialised
89e7090c5 is described below

commit 89e7090c59a0dd2fa1a556f83dbf7dee81f9df68
Author: Krzysztof Kopyściński <[email protected]>
AuthorDate: Wed Mar 27 08:46:43 2024 +0100

    controller/ble_ll_sync.c: acad_len potentially uninitialised
    
    acad_len in ble_ll_sync_rx_pkt_in is filled in ble_ll_sync_parse_ext_hdr
    and later accessed in ble_ll_sync_check_acad. There is a possibility
    that extended advertising header is missing data containing acad, and it
    will not get filled, leaving it uninitialised.
---
 nimble/controller/src/ble_ll_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_sync.c 
b/nimble/controller/src/ble_ll_sync.c
index 31c8ec04d..d15f1df00 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -1136,7 +1136,7 @@ ble_ll_sync_rx_pkt_in(struct os_mbuf *rxpdu, struct 
ble_mbuf_hdr *hdr)
     int8_t tx_power = 127; /* defaults to not available */
     uint8_t *aux = NULL;
     uint8_t *acad = NULL;
-    uint8_t acad_len;
+    uint8_t acad_len = 0;
     const uint8_t *biginfo = NULL;
     uint8_t biginfo_len = 0;
     int datalen;

Reply via email to