Fix a use of an uninitialized pointer in xdr_rpcbs_rmtcalllist().
This appears to have been introduced in r173763. Also fix the confusing indentation that probably led to the bug in the first place. PR: 243759 Diagnosed by: martin@lispworks.com MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
51d7f2ed58
commit
a3a706387e
@ -54,29 +54,28 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp)
|
||||
{
|
||||
struct rpcbs_addrlist **pnext;
|
||||
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcvers(xdrs, &objp->vers)) {
|
||||
}
|
||||
if (!xdr_rpcvers(xdrs, &objp->vers)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->success)) {
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->success)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->failure)) {
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->failure)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
|
||||
}
|
||||
if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
pnext = &objp->next;
|
||||
|
||||
if (!xdr_pointer(xdrs, (char **) pnext,
|
||||
pnext = &objp->next;
|
||||
if (!xdr_pointer(xdrs, (char **) pnext,
|
||||
sizeof (rpcbs_addrlist),
|
||||
(xdrproc_t)xdr_rpcbs_addrlist)) {
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
@ -86,86 +85,86 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp)
|
||||
bool_t
|
||||
xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *objp)
|
||||
{
|
||||
int32_t *buf;
|
||||
struct rpcbs_rmtcalllist **pnext;
|
||||
int32_t *buf;
|
||||
|
||||
if (xdrs->x_op == XDR_ENCODE) {
|
||||
buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
|
||||
if (buf == NULL) {
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcvers(xdrs, &objp->vers)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcproc(xdrs, &objp->proc)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->success)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->failure)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->indirect)) {
|
||||
return (FALSE);
|
||||
}
|
||||
} else {
|
||||
IXDR_PUT_U_INT32(buf, objp->prog);
|
||||
IXDR_PUT_U_INT32(buf, objp->vers);
|
||||
IXDR_PUT_U_INT32(buf, objp->proc);
|
||||
IXDR_PUT_INT32(buf, objp->success);
|
||||
IXDR_PUT_INT32(buf, objp->failure);
|
||||
IXDR_PUT_INT32(buf, objp->indirect);
|
||||
}
|
||||
if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
|
||||
return (FALSE);
|
||||
}
|
||||
pnext = &objp->next;
|
||||
if (!xdr_pointer(xdrs, (char **) pnext,
|
||||
sizeof (rpcbs_rmtcalllist),
|
||||
(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
|
||||
return (FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
if (xdrs->x_op == XDR_ENCODE) {
|
||||
buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
|
||||
if (buf == NULL) {
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcvers(xdrs, &objp->vers)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcproc(xdrs, &objp->proc)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->success)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->failure)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->indirect)) {
|
||||
return (FALSE);
|
||||
}
|
||||
} else {
|
||||
IXDR_PUT_U_INT32(buf, objp->prog);
|
||||
IXDR_PUT_U_INT32(buf, objp->vers);
|
||||
IXDR_PUT_U_INT32(buf, objp->proc);
|
||||
IXDR_PUT_INT32(buf, objp->success);
|
||||
IXDR_PUT_INT32(buf, objp->failure);
|
||||
IXDR_PUT_INT32(buf, objp->indirect);
|
||||
}
|
||||
if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_pointer(xdrs, (char **) pnext,
|
||||
sizeof (rpcbs_rmtcalllist),
|
||||
(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
|
||||
return (FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
} else if (xdrs->x_op == XDR_DECODE) {
|
||||
buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
|
||||
if (buf == NULL) {
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
|
||||
if (buf == NULL) {
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcvers(xdrs, &objp->vers)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcproc(xdrs, &objp->proc)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->success)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->failure)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->indirect)) {
|
||||
return (FALSE);
|
||||
}
|
||||
} else {
|
||||
objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
|
||||
objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
|
||||
objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
|
||||
objp->success = (int)IXDR_GET_INT32(buf);
|
||||
objp->failure = (int)IXDR_GET_INT32(buf);
|
||||
objp->indirect = (int)IXDR_GET_INT32(buf);
|
||||
}
|
||||
if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcvers(xdrs, &objp->vers)) {
|
||||
if (!xdr_pointer(xdrs, (char **) pnext,
|
||||
sizeof (rpcbs_rmtcalllist),
|
||||
(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_rpcproc(xdrs, &objp->proc)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->success)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->failure)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_int(xdrs, &objp->indirect)) {
|
||||
return (FALSE);
|
||||
}
|
||||
} else {
|
||||
objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
|
||||
objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
|
||||
objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
|
||||
objp->success = (int)IXDR_GET_INT32(buf);
|
||||
objp->failure = (int)IXDR_GET_INT32(buf);
|
||||
objp->indirect = (int)IXDR_GET_INT32(buf);
|
||||
}
|
||||
if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
|
||||
return (FALSE);
|
||||
}
|
||||
if (!xdr_pointer(xdrs, (char **) pnext,
|
||||
sizeof (rpcbs_rmtcalllist),
|
||||
(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
|
||||
return (FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
if (!xdr_rpcprog(xdrs, &objp->prog)) {
|
||||
return (FALSE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user