]> Git Repo - qemu.git/commitdiff
linux-user: fix undefined shift in copy_to_user_fdset
authorAndreas Schwab <[email protected]>
Tue, 9 Apr 2013 01:02:34 +0000 (01:02 +0000)
committerRiku Voipio <[email protected]>
Fri, 19 Apr 2013 07:48:51 +0000 (10:48 +0300)
If TARGET_ABI_BITS is bigger than 32 we shift by more than the size of int.

Signed-off-by: Andreas Schwab <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
linux-user/syscall.c

index d6d20502edf50947fe7f3ec3f93943015b059667..5a786f2fef8e3cab679e2155d3fe5ec27c9598be 100644 (file)
@@ -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]);
This page took 0.032564 seconds and 4 git commands to generate.