[krbdev.mit.edu #6121] dead code in lib/rpc/clnt_udp.c

Jochen Voss via RT rt-comment at krbdev.mit.edu
Sun Sep 14 17:28:12 EDT 2008


Hello,

while looking through the source of the Debian package
krb5-1.6.dfsg.4~beta1, I came across the following function
(file src/lib/rpc/clnt_udp.c, lines 221-407):

    static enum clnt_stat
    clntudp_call([...])
    {
	    [...]
	    else {
		    [...]
		    enum xdr_op op = reply_xdrs.x_op;
		    reply_xdrs.x_op = XDR_FREE;
		    xdr_replymsg(&reply_xdrs, &reply_msg);
		    reply_xdrs.x_op = op;
		    return (RPC_CANTDECODERES);
		    cu->cu_error.re_status = RPC_CANTDECODERES;
	    }
	    return (cu->cu_error.re_status);
    }

Since the "return (RPC_CANTDECODERES);" is unconditional, the
following assignment to cu->cu_error.re_status can never be reached.
I am not quite sure about the intention of the code, but my guess is,
that this assignment should just be removed.

I hope this helps,
Jochen
-- 
http://seehuhn.de/




More information about the krb5-bugs mailing list