mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue