Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: hidp: NUL terminate a string in the compat ioctl
This change is similar to commit a1616a5 ("Bluetooth: hidp: fix buffer overflow") but for the compat ioctl. We take a string from the user and forgot to ensure that it's NUL terminated. I have also changed the strncpy() in to strscpy() in hidp_setup_hid(). The difference is the strncpy() doesn't necessarily NUL terminate the destination string. Either change would fix the problem but it's nice to take a belt and suspenders approach and do both. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
- Loading branch information