HomeFreeBSD

Set ai2 to NULL in in find_host() before the loop and after calling

Description

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: 1006368, 1018506, 1305590, 1009293, 1194246
Reviewed by: rmacklem
Feedback from: hrs
MFC after: 1 week
Differential Revision: D6398

Details

Provenance
truckmanAuthored on
Reviewer
rmacklem
Differential Revision
D6398: Fix verious Coverity CIDS in rpc.lockd find_host()
Parents
rS299987: Ah, now I remember why we used that script.
Branches
Unknown
Tags
Unknown