fread() returns the number of items read, which should be checked. To
change the code example given, the ferror test can just be wrapped with
a check of the fread return compared to the item count. (This is
actually faster, too, since ferror() will only be called when there is
actually a problem.)
** Changed in: glibc (Ubuntu)
Assignee: (unassigned) => Kees Cook (kees)
Status: Triaged => Invalid
--
fread declared with __wur (warn_unused_result)
https://bugs.launchpad.net/bugs/249936
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs