summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2007-11-05 19:33:38 +0000
committerDenis Vlasenko2007-11-05 19:33:38 +0000
commitf8b21d0933a06120bcac6981eb022b0c68e199f0 (patch)
treeafa5dca647e5f1b5d89943018a6fac94f837ab11
parent15c38856880642527c3c2564b6d806233b252728 (diff)
downloadbusybox-f8b21d0933a06120bcac6981eb022b0c68e199f0.zip
busybox-f8b21d0933a06120bcac6981eb022b0c68e199f0.tar.gz
swaponoff: prevent arithmetic overflow (spotted by Paul Fox <pgf@brightstareng.com>)
-rw-r--r--util-linux/swaponoff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 6858d26..48f6f4e 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