DragonFlyBSD Kernel Audit
DF-1524 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/ath/ath_rate/sample/sample.c
+++ b/sys/dev/netif/ath/ath_rate/sample/sample.c
@@ -1252,7 +1252,13 @@
 	/*
 	 * Copy the statistics over to the provided buffer.
 	 */
-	copyout(sn, rs->buf + o, sizeof(struct sample_node));
+	{
+		struct sample_node sn_san;
+		sn_san = *sn;
+		sn_san.sched = NULL;
+		sn_san.currates = NULL;
+		copyout(&sn_san, rs->buf + o, sizeof(struct sample_node));
+	}
 	o += sizeof(struct sample_node);
 
 	kfree(tv, M_TEMP);