BT: Rectify size passed to copy service name to secu records
Use case: Services having name length greater than max lenght
always take new slot in security records. So, after few enable
disable cycles in BLE ON scenario, the record gets completely
occupied making further connection impossible.
Steps:
1. Install a BLE App to create BLE always ON scenario.
2. Run a few cycles of Bluetooth(bredr) enable-disable.
Failure: Once security records are completely occupied, new
connections are not possible because of socket creation
failure due to unavailability of security id.
Root cause: Size passed to copy service name does not include
bit for null termination. So, for services having name size
greater than that size have their last bit truncated for null
termication. So, during next enable, the comparision with
same size always fails causing service to take new slot in
security records array.
Fix: Increased the size passed to copy service name by 1 after
considering null termination.
Change-Id: I3527df6610932f60fd85bcdd14d5b8a527c79722
CRs-Fixed:
1026359