]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r301582
authortruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 15 Jun 2016 06:33:40 +0000 (06:33 +0000)
committertruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 15 Jun 2016 06:33:40 +0000 (06:33 +0000)
commit023ad9c14bd2cba83e29348771859198431f6622
tree6c4410436d23509fa819ad598753f33d71cdf6ca
parent88c0986156ab967246642431ee78dec3f4acb115
MFC     r301582

Explicitly NUL terminate the buffer filled by fread().

The fix in r300649 was not sufficient to convince Coverity that the
buffer was NUL terminated, even with the buffer pre-zeroed.  Swap
the size and nmemb arguments to fread() so that a valid lenght is
returned, which we can use to terminate the string in the buffer
at the correct location.  This should also quiet the complaint about
the return value of fread() not being checked.

Reported by: Coverity
CID: 10190541009614
Secur3ty:
Sponsore dby:

git-svn-id: svn://svn.freebsd.org/base/stable/10@301919 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/setfacl/file.c