From 5823703670689ad70effa6225ade50ef08e42da3 Mon Sep 17 00:00:00 2001 From: Roland Szabo Date: Thu, 20 Aug 2020 09:24:04 +0200 Subject: [PATCH] incorrect buffer index used when processing longer writes --- src/NimBLECharacteristic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NimBLECharacteristic.cpp b/src/NimBLECharacteristic.cpp index 5c3ff94..6f7d3d7 100644 --- a/src/NimBLECharacteristic.cpp +++ b/src/NimBLECharacteristic.cpp @@ -240,7 +240,7 @@ int NimBLECharacteristic::handleGapEvent(uint16_t conn_handle, uint16_t attr_han if((len + next->om_len) > BLE_ATT_ATTR_MAX_LEN) { return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN; } - memcpy(&buf[len-1], next->om_data, next->om_len); + memcpy(&buf[len], next->om_data, next->om_len); len += next->om_len; next = SLIST_NEXT(next, om_next); }