Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Prior
to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown blocksize" as expected, but sometimes also "maximum blocksize is 1G" and "minimum blocksize is 512" depending on what happened to be on the stack. Found by: LLVM/Clang Static Checker
This commit is contained in:
parent
d59e8ae886
commit
cb8330d036
@ -83,6 +83,7 @@ getbsize(headerlenp, blocksizep)
|
||||
default:
|
||||
fmterr: warnx("%s: unknown blocksize", p);
|
||||
n = 512;
|
||||
max = MAXB;
|
||||
mul = 1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user