Skip to content

Commit 73160d9

Browse files
vapierRiku Voipio
authored andcommitted
linux-user: fix sizeof handling for getsockopt
Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Riku Voipio <[email protected]>
1 parent 8d79de6 commit 73160d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

linux-user/syscall.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
14481448
return -TARGET_EFAULT;
14491449
if (len < 0)
14501450
return -TARGET_EINVAL;
1451-
lv = sizeof(int);
1451+
lv = sizeof(lv);
14521452
ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv));
14531453
if (ret < 0)
14541454
return ret;
@@ -1485,7 +1485,7 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
14851485
return -TARGET_EFAULT;
14861486
if (len < 0)
14871487
return -TARGET_EINVAL;
1488-
lv = sizeof(int);
1488+
lv = sizeof(lv);
14891489
ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv));
14901490
if (ret < 0)
14911491
return ret;

0 commit comments

Comments
 (0)