Skip to content

Commit 7ab51ef

Browse files
Roland Szaboh2zero
authored andcommitted
Fix incorrect buffer index used when processing longer writes
1 parent a4a711f commit 7ab51ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NimBLECharacteristic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int NimBLECharacteristic::handleGapEvent(uint16_t conn_handle, uint16_t attr_han
240240
if((len + next->om_len) > BLE_ATT_ATTR_MAX_LEN) {
241241
return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
242242
}
243-
memcpy(&buf[len-1], next->om_data, next->om_len);
243+
memcpy(&buf[len], next->om_data, next->om_len);
244244
len += next->om_len;
245245
next = SLIST_NEXT(next, om_next);
246246
}

0 commit comments

Comments
 (0)