Fix incorrect masking in swp_getmapping()
commitee8104bbaa41271be7814428023dd6d8937b9191
authorPetr Tesarik <petr@tesarici.cz>
Thu, 27 Sep 2012 15:45:41 +0000 (27 17:45 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Thu, 27 Sep 2012 15:45:41 +0000 (27 17:45 +0200)
tree2e2b136af38e56ad0f7966af6ef94841d94cd104
parente459d77188ee07752e978ec026af35e53c638672
Fix incorrect masking in swp_getmapping()

This is broken on 64-bit architectures, because (unsigned long) mapof
is 64 bits and (unsigned int) SWP_MAPSIZE is only 32-bit, so, we are
masking off the high 32 bits of mapoff. Of course, this bug is really
hard to trigger, because a mapoff greater than 2^32 needs a swap
position larger than than 2^42 (4 TiB).
libhed/swap.c