From e6bdc5761e5340b0df03c2b5c344b04feabaad9e Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 20 Jul 2011 09:47:49 -0400 Subject: [PATCH] Segfault in SVCAUTH_WRAP call The xprt->xp_auth pointer need to be checked before used in the SVCAUTH_WRAP call since it can be NULL during error conditions. Signed-off-by: Steve Dickson --- src/svc_dg.c | 4 ++-- src/svc_vc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/svc_dg.c b/src/svc_dg.c index 5ef9df2..081db61 100644 --- a/src/svc_dg.c +++ b/src/svc_dg.c @@ -254,8 +254,8 @@ svc_dg_reply(xprt, msg) XDR_SETPOS(xdrs, 0); msg->rm_xid = su->su_xid; if (xdr_replymsg(xdrs, msg) && - (!has_args || - (SVCAUTH_WRAP(xprt->xp_auth, xdrs, xdr_results, xdr_location)))) { + (!has_args || (xprt->xp_auth && + SVCAUTH_WRAP(xprt->xp_auth, xdrs, xdr_results, xdr_location)))) { struct msghdr *msg = &su->su_msghdr; struct iovec iov; diff --git a/src/svc_vc.c b/src/svc_vc.c index 74632e2..4c70de8 100644 --- a/src/svc_vc.c +++ b/src/svc_vc.c @@ -698,8 +698,8 @@ svc_vc_reply(xprt, msg) msg->rm_xid = cd->x_id; rstat = FALSE; if (xdr_replymsg(xdrs, msg) && - (!has_args || - (SVCAUTH_WRAP(xprt->xp_auth, xdrs, xdr_results, xdr_location)))) { + (!has_args || (xprt->xp_auth && + SVCAUTH_WRAP(xprt->xp_auth, xdrs, xdr_results, xdr_location)))) { rstat = TRUE; } (void)xdrrec_endofrecord(xdrs, TRUE); -- 2.40.0