mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-26 15:29:07 +00:00
b2sum: fix UAR with --check with malformed checksum lines
* src/digest.c (split_3): Reinstate the check for whitespace after the digest portion of the line, so that we exit early before inspecting the file name which would be outside the passed buffer in the case where the input does not contain a newline. * tests/cksum/b2sum.sh: Add a test case. * NEWS: Mention the bug fix. * THANKS.in: Add Frank Busse who has reported multiple bugs using KLEE. Fixes https://bugs.gnu.org/64229
This commit is contained in:
parent
ed9d8b8730
commit
e8858f1515
4
NEWS
4
NEWS
@ -8,6 +8,10 @@ GNU coreutils NEWS -*- outline -*-
|
||||
fail on files with inode numbers that do not fit into 32 bits.
|
||||
[This bug was present in "the beginning".]
|
||||
|
||||
'b2sum --check' will no longer read unallocated memory when
|
||||
presented with malformed checksum lines.
|
||||
[bug introduced in coreutils-9.2]
|
||||
|
||||
'cp --parents' again succeeds when preserving mode for absolute directories.
|
||||
Previously it would have failed with a "No such file or directory" error.
|
||||
[bug introduced in coreutils-9.1]
|
||||
|
||||
@ -211,6 +211,7 @@ Francesco Montorsi fr_m@hotmail.com
|
||||
François Pinard pinard@iro.umontreal.ca
|
||||
François Rigault rigault.francois@gmail.com
|
||||
Frank Adler fadler@allesklar.de
|
||||
Frank Busse f.busse@imperial.ac.uk
|
||||
Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
|
||||
Fred Fish fnf@ninemoons.com
|
||||
Frédéric L. W. Meunier 0@pervalidus.net
|
||||
|
||||
@ -862,6 +862,10 @@ split_3 (char *s, size_t s_len,
|
||||
while (s[i] && !ISWHITE (s[i]))
|
||||
i++;
|
||||
|
||||
/* The digest must be followed by at least one whitespace character. */
|
||||
if (i == s_len)
|
||||
return false;
|
||||
|
||||
*d_len = &s[i] - (char *) *digest;
|
||||
s[i++] = '\0';
|
||||
|
||||
|
||||
@ -61,6 +61,11 @@ printf '%s\n' 'BLAKE2' 'BLAKE2b' 'BLAKE2-' 'BLAKE2(' 'BLAKE2 (' > crash.check \
|
||||
|| framework_failure_
|
||||
returns_ 1 $prog -c crash.check || fail=1
|
||||
|
||||
# This would read unallocated memory from coreutils-9.2 to coreutils-9.3
|
||||
# which would trigger with ASAN or valgrind
|
||||
printf '0A0BA0' > overflow.check || framework_failure_
|
||||
returns_ 1 $prog -c overflow.check || fail=1
|
||||
|
||||
done
|
||||
|
||||
Exit $fail
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user