]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/bluetooth/hidp/sock.c
Bluetooth: hidp: fix buffer overflow
[mirror_ubuntu-bionic-kernel.git] / net / bluetooth / hidp / sock.c
index 008ba439bd62ae2e55a7ff92900ebb88339d67d1..cc80c76177b6e3f5e3343c758ebc462eee201fae 100644 (file)
@@ -76,6 +76,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
                        sockfd_put(csock);
                        return err;
                }
+               ca.name[sizeof(ca.name)-1] = 0;
 
                err = hidp_connection_add(&ca, csock, isock);
                if (!err && copy_to_user(argp, &ca, sizeof(ca)))