aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc64/solaris/socket.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 18:19:10 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 18:19:10 -0700
commit9723d95d1076e9ef394ff26162fb0b47531089b0 (patch)
tree242504391bf7f373cd5198d32df29868ea2996e2 /arch/sparc64/solaris/socket.c
parent4a4f8fdba6f5a34ca90f426021e17491a30202da (diff)
parent7049e6800f40046c384c522a990669024d5f5836 (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Diffstat (limited to 'arch/sparc64/solaris/socket.c')
-rw-r--r--arch/sparc64/solaris/socket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c
index ec8e074c4ea..06740582717 100644
--- a/arch/sparc64/solaris/socket.c
+++ b/arch/sparc64/solaris/socket.c
@@ -317,8 +317,10 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
unsigned long *kcmsg;
compat_size_t cmlen;
- if(kern_msg.msg_controllen > sizeof(ctl) &&
- kern_msg.msg_controllen <= 256) {
+ if (kern_msg.msg_controllen <= sizeof(compat_size_t))
+ return -EINVAL;
+
+ if(kern_msg.msg_controllen > sizeof(ctl)) {
err = -ENOBUFS;
ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL);
if(!ctl_buf)