projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a831b91
)
NFC: Dereference LLCP bind socket address after checking for it to be NULL
author
Samuel Ortiz
<sameo@linux.intel.com>
Fri, 29 Jun 2012 10:03:55 +0000
(12:03 +0200)
committer
John W. Linville
<linville@tuxdriver.com>
Mon, 9 Jul 2012 20:42:22 +0000
(16:42 -0400)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/llcp/sock.c
patch
|
blob
|
history
diff --git
a/net/nfc/llcp/sock.c
b/net/nfc/llcp/sock.c
index e5d80142b825298d134cd6a08ec8d23406496e3c..6152d05f83789f1ceb3107670c8739cd46770705 100644
(file)
--- a/
net/nfc/llcp/sock.c
+++ b/
net/nfc/llcp/sock.c
@@
-78,11
+78,11
@@
static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
struct sockaddr_nfc_llcp llcp_addr;
int len, ret = 0;
- pr_debug("sk %p addr %p family %d\n", sk, addr, addr->sa_family);
-
if (!addr || addr->sa_family != AF_NFC)
return -EINVAL;
+ pr_debug("sk %p addr %p family %d\n", sk, addr, addr->sa_family);
+
memset(&llcp_addr, 0, sizeof(llcp_addr));
len = min_t(unsigned int, sizeof(llcp_addr), alen);
memcpy(&llcp_addr, addr, len);