Patchwork linux-user: fix sizeof handling for getsockopt

login
register
mail settings
Submitter Mike Frysinger
Date Jan. 24, 2011, 7:57 a.m.
Message ID <1295855870-30284-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/80097/
State New
Headers show

Comments

Mike Frysinger - Jan. 24, 2011, 7:57 a.m.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 linux-user/syscall.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 499c4d7..6116ab5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1448,7 +1448,7 @@  static abi_long do_getsockopt(int sockfd, int level, int optname,
             return -TARGET_EFAULT;
         if (len < 0)
             return -TARGET_EINVAL;
-        lv = sizeof(int);
+        lv = sizeof(lv);
         ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv));
         if (ret < 0)
             return ret;
@@ -1485,7 +1485,7 @@  static abi_long do_getsockopt(int sockfd, int level, int optname,
                 return -TARGET_EFAULT;
             if (len < 0)
                 return -TARGET_EINVAL;
-            lv = sizeof(int);
+            lv = sizeof(lv);
             ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv));
             if (ret < 0)
                 return ret;