diff options
| author | Pádraig Brady <P@draigBrady.com> | 2025-08-30 12:08:24 +0100 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2025-08-30 12:44:29 +0100 |
| commit | 735a4a27f3d3a4bb3a0381c45b7deb936cc293c2 (patch) | |
| tree | 3ec5fad55681d39720cf195f7953352786e01565 /src | |
| parent | fold: fix handling of invalid multi-byte characters (diff) | |
| download | coreutils-735a4a27f3d3a4bb3a0381c45b7deb936cc293c2.tar.gz coreutils-735a4a27f3d3a4bb3a0381c45b7deb936cc293c2.zip | |
b2sum: --length: fix upper bound check
* src/digest.c (main): Don't saturate -l to BLAKE2B_MAX_LEN,
so that the subsequent bounds check is performed.
* tests/cksum/b2sum.sh: Add a test case.
* NEWS: Mention the fix introduced in commit v9.5-71-gf2c84fe63
Diffstat (limited to 'src')
| -rw-r--r-- | src/digest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/digest.c b/src/digest.c index 302739e9f..0e4e62dee 100644 --- a/src/digest.c +++ b/src/digest.c @@ -1402,7 +1402,7 @@ main (int argc, char **argv) #endif #if HASH_ALGO_BLAKE2 || HASH_ALGO_CKSUM case 'l': - digest_length = xnumtoumax (optarg, 10, 0, BLAKE2B_MAX_LEN * 8, "", + digest_length = xnumtoumax (optarg, 10, 0, UINTMAX_MAX, "", _("invalid length"), 0, XTOINT_MAX_QUIET); digest_length_str = optarg; |
