aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc64/solaris/socket.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-22 21:50:57 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-22 21:50:57 -0400
commita5324343955997d1439f26518ddac567cd5d134b (patch)
treef43558389c41e3a0f076c4ee55d77c4aa1561779 /arch/sparc64/solaris/socket.c
parent8199d3a79c224bbe5943fa08684e1f93a17881b0 (diff)
parenta4936044001694f033fe4ea94d6034d51a6b465c (diff)
Merge /spare/repo/linux-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)