mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
bluetooth: Validate socket address length in sco_sock_bind().
Change-Id: I890640975f1af64f71947b6a1820249e08f6375b Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
504d01b884
commit
29b4575124
1 changed files with 3 additions and 0 deletions
|
@ -499,6 +499,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
|
|||
if (!addr || addr->sa_family != AF_BLUETOOTH)
|
||||
return -EINVAL;
|
||||
|
||||
if (alen < sizeof(struct sockaddr_sco))
|
||||
return -EINVAL;
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
len = min_t(unsigned int, sizeof(sa), alen);
|
||||
memcpy(&sa, addr, len);
|
||||
|
|
Loading…
Reference in a new issue