mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
swaponoff: prevent arithmetic overflow (spotted by Paul Fox <pgf@brightstareng.com>)
This commit is contained in:
parent
15c3885688
commit
f8b21d0933
@ -21,7 +21,7 @@ static int swap_enable_disable(char *device)
|
|||||||
#if ENABLE_DESKTOP
|
#if ENABLE_DESKTOP
|
||||||
/* test for holes */
|
/* test for holes */
|
||||||
if (S_ISREG(st.st_mode))
|
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");
|
bb_error_msg("warning: swap file has holes");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user