From 2614eccf45995a836ed29c6930f8b0d9ff396308 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Thu, 8 Feb 2018 14:53:34 +0000 Subject: [PATCH] su_data: correct macro expansion. Protect su_data() users from strange macro expansion. Obtained from: linux libtirpc --- lib/libc/rpc/svc_dg.c | 2 +- usr.sbin/ypserv/yp_svc_udp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/rpc/svc_dg.c b/lib/libc/rpc/svc_dg.c index 54dbb0956a11..c7e0726270b7 100644 --- a/lib/libc/rpc/svc_dg.c +++ b/lib/libc/rpc/svc_dg.c @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include "rpc_com.h" #include "mt_misc.h" -#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) +#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2)) #define rpc_buffer(xprt) ((xprt)->xp_p1) #ifndef MAX diff --git a/usr.sbin/ypserv/yp_svc_udp.c b/usr.sbin/ypserv/yp_svc_udp.c index c865c01d9b7e..288bd28423b1 100644 --- a/usr.sbin/ypserv/yp_svc_udp.c +++ b/usr.sbin/ypserv/yp_svc_udp.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "yp_extern.h" -#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) +#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2)) /* * We need to be able to manually set the transaction ID in the