Module Name:    src
Committed By:   martin
Date:           Wed Apr 22 18:15:12 UTC 2020

Modified Files:
        src/sys/compat/ossaudio [netbsd-8]: ossaudio.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1535):

        sys/compat/ossaudio/ossaudio.c: revision 1.83

ossaudio: Avoid giving userland uninitialized memory. Noticed by maxv.

The uninitalized field in this structure is `fillers`, an array that
simply reserves space for later changes in OSSv4, which this version
of the OSS compat layer (specifically for Linux applications) makes no
effort to implement.


To generate a diff of this commit:
cvs rdiff -u -r1.70.6.2 -r1.70.6.3 src/sys/compat/ossaudio/ossaudio.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/compat/ossaudio/ossaudio.c
diff -u src/sys/compat/ossaudio/ossaudio.c:1.70.6.2 src/sys/compat/ossaudio/ossaudio.c:1.70.6.3
--- src/sys/compat/ossaudio/ossaudio.c:1.70.6.2	Tue Jan 21 18:12:54 2020
+++ src/sys/compat/ossaudio/ossaudio.c	Wed Apr 22 18:15:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.70.6.2 2020/01/21 18:12:54 martin Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.70.6.3 2020/04/22 18:15:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.70.6.2 2020/01/21 18:12:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.70.6.3 2020/04/22 18:15:12 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1075,6 +1075,7 @@ oss_ioctl_mixer(struct lwp *lwp, const s
 			    __func__, error));
 			goto out;
 		}
+		memset(&omi, 0, sizeof omi);
 		omi.modify_counter = 1;
 		strncpy(omi.id, adev.name, sizeof omi.id);
 		strncpy(omi.name, adev.name, sizeof omi.name);

Reply via email to