commit d583d12300a8990715824857400aaa7f66699333
Author: Hiltjo Posthuma <[email protected]>
Date:   Mon Mar 30 19:58:06 2015 +0200

    du: fix possible division by zero if $BLOCKSIZE is 0
    
    these kind of $BLOCKSIZE dont make sense, but dont crash atleast.

diff --git a/du.c b/du.c
index b20201a..0bc732b 100644
--- a/du.c
+++ b/du.c
@@ -94,7 +94,7 @@ main(int argc, char *argv[])
 
        bsize = getenv("BLOCKSIZE");
        if (bsize)
-               blksize = estrtonum(bsize, 0, MIN(LLONG_MAX, SIZE_MAX));
+               blksize = estrtonum(bsize, 1, MIN(LLONG_MAX, SIZE_MAX));
        if (kflag)
                blksize = 1024;
 

Reply via email to