diff options
author | Andreas Schwab <schwab@suse.de> | 2013-04-09 01:02:34 +0000 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2013-04-19 10:48:51 +0300 |
commit | 9ab709be595bef9956ea550a95e14e157cb5704e (patch) | |
tree | 2430e9ef4a5bbcb87f44831a8271aec03a6d5539 /linux-user/syscall.c | |
parent | c7128c9fd58ee92cae70c7cd1d53acc529cebbbb (diff) |
linux-user: fix undefined shift in copy_to_user_fdset
If TARGET_ABI_BITS is bigger than 32 we shift by more than the size of int.
Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r-- | linux-user/syscall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d6d20502ed..5a786f2fef 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -914,7 +914,7 @@ static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr, for (i = 0; i < nw; i++) { v = 0; for (j = 0; j < TARGET_ABI_BITS; j++) { - v |= ((FD_ISSET(k, fds) != 0) << j); + v |= ((abi_ulong)(FD_ISSET(k, fds) != 0) << j); k++; } __put_user(v, &target_fds[i]); |