Module Name: src
Committed By: mrg
Date: Tue Aug 8 06:57:20 UTC 2023
Modified Files:
src/sys/dev/pci: sisfb.c
Log Message:
ensure all data passed to copyout() has been initialised.
found by GCC 12.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/sisfb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/sisfb.c
diff -u src/sys/dev/pci/sisfb.c:1.8 src/sys/dev/pci/sisfb.c:1.9
--- src/sys/dev/pci/sisfb.c:1.8 Tue Sep 21 14:47:28 2021
+++ src/sys/dev/pci/sisfb.c Tue Aug 8 06:57:20 2023
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.8 2021/09/21 14:47:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.9 2023/08/08 06:57:20 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -694,6 +694,8 @@ sisfb_getcmap(uint8_t *cmap, struct wsdi
dst = ramp;
for (i = 0; i < count; i++)
*dst++ = *src, src += 3;
+ for (; i < sizeof(ramp); i++)
+ *dst++ = 0;
rc = copyout(ramp, cm->red, count);
if (rc != 0)
return rc;