diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-05 19:33:38 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-05 19:33:38 +0000 |
commit | f8b21d0933a06120bcac6981eb022b0c68e199f0 (patch) | |
tree | afa5dca647e5f1b5d89943018a6fac94f837ab11 /util-linux/swaponoff.c | |
parent | 15c38856880642527c3c2564b6d806233b252728 (diff) | |
download | busybox-w32-f8b21d0933a06120bcac6981eb022b0c68e199f0.tar.gz busybox-w32-f8b21d0933a06120bcac6981eb022b0c68e199f0.tar.bz2 busybox-w32-f8b21d0933a06120bcac6981eb022b0c68e199f0.zip |
swaponoff: prevent arithmetic overflow (spotted by Paul Fox <pgf@brightstareng.com>)
Diffstat (limited to 'util-linux/swaponoff.c')
-rw-r--r-- | util-linux/swaponoff.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
21 | #if ENABLE_DESKTOP | 21 | #if ENABLE_DESKTOP |
22 | /* test for holes */ | 22 | /* test for holes */ |
23 | if (S_ISREG(st.st_mode)) | 23 | if (S_ISREG(st.st_mode)) |
24 | if (st.st_blocks * 512 < st.st_size) | 24 | if (st.st_blocks * (off_t)512 < st.st_size) |
25 | bb_error_msg("warning: swap file has holes"); | 25 | bb_error_msg("warning: swap file has holes"); |
26 | #endif | 26 | #endif |
27 | 27 | ||