summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet/sctp_sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/netinet/sctp_sysctl.c')
-rw-r--r--freebsd/sys/netinet/sctp_sysctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/freebsd/sys/netinet/sctp_sysctl.c b/freebsd/sys/netinet/sctp_sysctl.c
index ba7a00bf..d0da7a6f 100644
--- a/freebsd/sys/netinet/sctp_sysctl.c
+++ b/freebsd/sys/netinet/sctp_sysctl.c
@@ -686,14 +686,18 @@ static int
sysctl_stat_get(SYSCTL_HANDLER_ARGS)
{
int cpu, error;
- struct sctpstat sb, *sarry, *cpin = NULL;
+ struct sctpstat sb, sb_temp, *sarry, *cpin = NULL;
if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) {
/*
* User wants us to clear or at least reset the counters to
* the specified values.
*/
- cpin = (struct sctpstat *)req->newptr;
+ cpin = &sb_temp;
+ memset(&sb_temp, 0, sizeof(sb_temp));
+ error = SYSCTL_IN(req, &sb_temp, sizeof(sb_temp));
+ if (error != 0)
+ return (error);
} else if (req->newptr) {
/* Must be a stat structure */
return (EINVAL);