From 9790837584c276340a000bcd68aa249fef6b77df Mon Sep 17 00:00:00 2001 From: pfg Date: Sun, 27 Mar 2016 19:43:26 +0000 Subject: [PATCH] MFC r296095: 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) git-svn-id: svn://svn.freebsd.org/base/stable/9@297320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- 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 942d07e8c..2e98c6a6a 100644 --- a/lib/libc/rpc/svc_simple.c +++ b/lib/libc/rpc/svc_simple.c @@ -272,7 +272,7 @@ universal(rqstp, 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 -- 2.45.0