fscrypt-crypt-util: clean up parsing --block-size and --inode-number
authorEric Biggers <ebiggers@google.com>
Thu, 1 Oct 2020 00:25:03 +0000 (17:25 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 11 Oct 2020 03:27:38 +0000 (11:27 +0800)
commitfa650493ef9f8f9aa4cdae0cc5c27f470293f2c0
tree434f0ba5831e14daeb3e6c004ff6114e0170ae50
parent72a84addd22781b0d322547c532c3950b49e3802
fscrypt-crypt-util: clean up parsing --block-size and --inode-number

For --block-size, check for strtoul() reporting an overflow.

For --inode-number, check for strtoull() reporting an overflow.

Also, move the check for 32-bit inode numbers into a more logical place
(the place where we check the encryption format-specific limitations).

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Daeho Jeong <daeho43@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/fscrypt-crypt-util.c