Skip to content

Commit

Permalink
Merge pull request #32 from WebPlatformForEmbedded/fix/HCISocket--pin…
Browse files Browse the repository at this point in the history
…code-copy
  • Loading branch information
bramoosterhuis authored Feb 2, 2024
2 parents ae32d9b + 4693c4c commit 17f66a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/bluetooth/HCISocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,8 @@ uint32_t ManagementSocket::UserPINCodeReply(const Address& remote, const Address
Management::UserPINCodeReply command(_deviceId);
command->addr.bdaddr = *remote.Data();
command->addr.type = type;
command->pin_len = std::max(pinCode.length(), sizeof(command->pin_code));
::strncpy(reinterpret_cast<char*>(command->pin_code), pinCode.c_str(), sizeof(command->pin_code));
command->pin_len = std::min(pinCode.length(), sizeof(command->pin_code));
::memcpy(command->pin_code, pinCode.c_str(), std::min(pinCode.length(), sizeof(command->pin_code)));
result = Exchange(MANAGMENT_TIMEOUT, command, command);
commandResult = command.Result();
} else {
Expand Down

0 comments on commit 17f66a1

Please sign in to comment.