]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Set ai2 to NULL in in find_host() before the loop and after calling
authortruckman <truckman@FreeBSD.org>
Mon, 16 May 2016 23:29:04 +0000 (23:29 +0000)
committertruckman <truckman@FreeBSD.org>
Mon, 16 May 2016 23:29:04 +0000 (23:29 +0000)
commitdb9ff4b77a503480f472815c7814830deb561e21
tree871d7796dec166eeb28aefd73f768ed8d726a20a
parent1c0505b26ca4d162d7b0ba3188e34dd21c616c54
Set ai2 to NULL in in find_host() before the loop and after calling
freeaddrinfo() on it to indicate that it doesn't point to a valid
addrinfo list.  This fixes this Coverity issues:
1006368 Uninitialized pointer read
1018506 Double free
1305590 Resource leak
that can be triggered in the hp->hostname[0] != '\0' case.

Don't treat a character as a boolean.

Fix these Coverity issues:
1009293 Unchecked return value from library
1194246 Wrong size argument
by tweaking the status file extend code.

Reported by: Coverity
CID: 10063681018506130559010092931194246
Reviewed by: rmacklem
Feedback from: hrs
MFC after: 1 week
Differential Revision: D6398
usr.sbin/rpc.statd/file.c