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

andk 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 bc782834 ble_hci_socket.c: fix warning 'len' may be used uninitialized 
in this function [-Wmaybe-uninitialized]
bc782834 is described below

commit bc7828341226d860429c63994065f8f1b8b8d7b0
Author: raiden00pl <[email protected]>
AuthorDate: Wed Mar 1 19:26:49 2023 +0100

    ble_hci_socket.c: fix warning 'len' may be used uninitialized in this 
function [-Wmaybe-uninitialized]
---
 nimble/transport/socket/src/ble_hci_socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nimble/transport/socket/src/ble_hci_socket.c 
b/nimble/transport/socket/src/ble_hci_socket.c
index 059bf4a9..d77baef6 100644
--- a/nimble/transport/socket/src/ble_hci_socket.c
+++ b/nimble/transport/socket/src/ble_hci_socket.c
@@ -334,6 +334,7 @@ ble_hci_sock_cmdevt_tx(uint8_t *hci_ev, uint8_t h4_type)
 
     memcpy(&addr, &addr, sizeof(struct sockaddr_hci));
 
+    len = 0;
     if (h4_type == BLE_HCI_UART_H4_CMD) {
         len = sizeof(struct ble_hci_cmd) + hci_ev[2];
         STATS_INC(hci_sock_stats, ocmd);

Reply via email to