mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
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>
This commit is contained in:
parent
c7128c9fd5
commit
9ab709be59
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user