From a6221f7b5187ac6541026f3eb5f1189d546ecc98 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Fri, 26 Feb 2016 14:39:39 +0000 Subject: [PATCH] rpc: fix failure to clear string by passing the wrong size to memset. Noted by NetBSD's PR/21014 Obtained from: NetBSD (CVS Rev. 1.24, 1.25) MFC after: 1 month --- lib/libc/rpc/svc_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c index 9ce3f8d4efbc..1c60950e0a21 100644 --- a/lib/libc/rpc/svc_simple.c +++ b/lib/libc/rpc/svc_simple.c @@ -272,7 +272,7 @@ universal(struct svc_req *rqstp, SVCXPRT *transp) /* decode arguments into a CLEAN buffer */ xdrbuf = pl->p_xdrbuf; /* Zero the arguments: reqd ! */ - (void) memset(xdrbuf, 0, sizeof (pl->p_recvsz)); + (void) memset(xdrbuf, 0, (size_t)pl->p_recvsz); /* * Assuming that sizeof (xdrbuf) would be enough * for the arguments; if not then the program