projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1a8fee
)
[NET]: Ensure device name passed to SO_BINDTODEVICE is NULL terminated.
author
David S. Miller
<davem@davemloft.net>
Fri, 24 Mar 2006 06:47:40 +0000
(22:47 -0800)
committer
David S. Miller
<davem@sunset.davemloft.net>
Fri, 24 Mar 2006 23:44:59 +0000
(15:44 -0800)
Found by Solar Designer.
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/sock.c
b/net/core/sock.c
index 1a7e6eac90b04f89efca8620ed64686496a8e647..e110b9004147b4418391467a4b31715a5dc2902a 100644
(file)
--- a/
net/core/sock.c
+++ b/
net/core/sock.c
@@
-404,8
+404,9
@@
set_rcvbuf:
if (!valbool) {
sk->sk_bound_dev_if = 0;
} else {
- if (optlen > IFNAMSIZ)
- optlen = IFNAMSIZ;
+ if (optlen > IFNAMSIZ - 1)
+ optlen = IFNAMSIZ - 1;
+ memset(devname, 0, sizeof(devname));
if (copy_from_user(devname, optval, optlen)) {
ret = -EFAULT;
break;