Commit 9ab709be authored by Andreas Schwab's avatar Andreas Schwab Committed by Riku Voipio
Browse files

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: default avatarAndreas Schwab <schwab@suse.de>
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
parent c7128c9f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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]);