krb5/krb5 — pull request #164 by lslebodn (2014-07-02 18:40:16+00:00)
Title: Devel

Attached are few patches which fixes warnings from static analysers.
Many of them can be squashed to the one patch but review of simpler patches
would be easier. Any comments are welcomed.

Here are code flow which results into calling function close with
negative number.

Error: NEGATIVE_RETURNS
krb5-1.13.0/src/lib/krad/remote.c:400: var_tested_neg: Assigning: "tmp->fd" = a negative value.
krb5-1.13.0/src/lib/krad/remote.c:420: negative_returns: "tmp->fd" is passed to a parameter that cannot be negative.
krb5-1.13.0/src/lib/krad/remote.c:437:5: neg_sink_parm_call: Passing "rr->fd" to "remote_disconnect", which cannot accept a negative number.
krb5-1.13.0/src/lib/krad/remote.c:147:5: neg_sink_parm_call: Passing "rr->fd" to "close", which cannot accept a negative number.

Error: NEGATIVE_RETURNS
krb5-1.13.0/src/lib/rpc/clnt_simple.c:90: var_tested_neg: Assigning: "crp->socket" = a negative value.
krb5-1.13.0/src/lib/rpc/clnt_simple.c:97: negative_returns: "crp->socket" is passed to a parameter that cannot be negative.

Error: NEGATIVE_RETURNS
krb5-1.13.0/src/lib/rpc/pmap_rmt.c:276: negative_return_fn: Function "socket(2, SOCK_DGRAM, IPPROTO_UDP)" returns a negative number.
krb5-1.13.0/src/lib/rpc/pmap_rmt.c:276: var_assign: Assigning: signed variable "sock" = "socket".
krb5-1.13.0/src/lib/rpc/pmap_rmt.c:414: negative_returns: "sock" is passed to a parameter that cannot be negative.