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

commit a62df8ccad5b365f3dbdb906a74721f29b6880c6
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Nov 19 15:19:01 2025 +0100

    nimble/host/test: Fix buffer oveflows in GATT tests
    
    Those are used for invalid tests and thus requires extra bytes for
    invalid data.
---
 nimble/host/test/src/ble_gatt_write_test.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/nimble/host/test/src/ble_gatt_write_test.c 
b/nimble/host/test/src/ble_gatt_write_test.c
index ea815c0d5..bfceb4d4e 100644
--- a/nimble/host/test/src/ble_gatt_write_test.c
+++ b/nimble/host/test/src/ble_gatt_write_test.c
@@ -29,7 +29,8 @@
 
 static int ble_gatt_write_test_cb_called;
 
-static uint8_t ble_gatt_write_test_attr_value[BLE_ATT_ATTR_MAX_LEN];
+/* This is used for invalid tests too so must be bigger than max value len */
+static uint8_t ble_gatt_write_test_attr_value[BLE_ATT_ATTR_MAX_LEN * 2];
 static struct ble_gatt_error ble_gatt_write_test_error;
 
 static struct ble_hs_test_util_flat_attr
@@ -92,7 +93,7 @@ ble_gatt_write_test_rx_prep_rsp(uint16_t conn_handle, 
uint16_t cid,
                                 const void *attr_data, uint16_t attr_data_len)
 {
     struct ble_att_prep_write_cmd rsp;
-    uint8_t buf[512];
+    uint8_t buf[517];
     int rc;
 
     rsp.bapc_handle = attr_handle;

Reply via email to