From: Denis Vlasenko Date: Mon, 5 Nov 2007 19:33:38 +0000 (-0000) Subject: swaponoff: prevent arithmetic overflow (spotted by Paul Fox ) X-Git-Tag: 1_9_0~141 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f8b21d0933a06120bcac6981eb022b0c68e199f0;p=oweals%2Fbusybox.git swaponoff: prevent arithmetic overflow (spotted by Paul Fox ) --- diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 6858d2619..48f6f4e0b 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -21,7 +21,7 @@ static int swap_enable_disable(char *device) #if ENABLE_DESKTOP /* test for holes */ if (S_ISREG(st.st_mode)) - if (st.st_blocks * 512 < st.st_size) + if (st.st_blocks * (off_t)512 < st.st_size) bb_error_msg("warning: swap file has holes"); #endif