mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
md5: Fix input error check.
Fixes: 4849767cb1
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: tsoome, kevans, lwhsu
Differential Revision: https://reviews.freebsd.org/D40017
This commit is contained in:
parent
0e04dd3b66
commit
f1ceb05a46
|
@ -686,7 +686,7 @@ MDInput(const Algorithm_t *alg, FILE *f, char *buf, bool tee)
|
|||
switch (input_mode) {
|
||||
case input_binary:
|
||||
case input_text:
|
||||
if (tee && fwrite(block, 1, len, stdout) != (size_t)len)
|
||||
if (tee && fwrite(block, 1, len, stdout) != len)
|
||||
err(1, "stdout");
|
||||
alg->Update(&context, block, len);
|
||||
break;
|
||||
|
@ -734,7 +734,7 @@ MDInput(const Algorithm_t *alg, FILE *f, char *buf, bool tee)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (len < 0) {
|
||||
if (ferror(f)) {
|
||||
alg->End(&context, buf);
|
||||
return (NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue