Fixes: 4849767cb16a
MFC after: 1 week
Sponsored by: Klara, Inc.
Details
Details
- Reviewers
lwhsu tsoome kevans - Group Reviewers
Klara - Commits
- rGf1ceb05a469f: md5: Fix input error check.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 51389 Build 48280: arc lint + arc unit
Event Timeline
sbin/md5/md5.c | ||
---|---|---|
685 | There is actually potential problem. fread() can return value between 0 to sizeof(block) in case of error or eof, I guess it is ok to have short read in case of eof, but we probably want to be sure there was no error. It may be better to use do {} while (!ferror() && !feof()) loop there. | |
689 | len is already size_t, you can drop the type cast. |
sbin/md5/md5.c | ||
---|---|---|
685 | I don't see the problem. The next fread() would return zero which ends the loop, and ferror() after that will return non-zero and we will report the error. |