summaryrefslogtreecommitdiff
path: root/sys/compat/sunos32/sunos32_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/sunos32/sunos32_ioctl.c')
-rw-r--r--sys/compat/sunos32/sunos32_ioctl.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/compat/sunos32/sunos32_ioctl.c b/sys/compat/sunos32/sunos32_ioctl.c
index 5dfc46ccac8..40db29c54be 100644
--- a/sys/compat/sunos32/sunos32_ioctl.c
+++ b/sys/compat/sunos32/sunos32_ioctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_ioctl.c,v 1.35 2019/04/23 07:45:06 msaitoh Exp $ */
+/* $NetBSD: sunos32_ioctl.c,v 1.35.2.1 2022/08/03 11:11:33 martin Exp $ */
/* from: NetBSD: sunos_ioctl.c,v 1.35 2001/02/03 22:20:02 mrg Exp */
/*
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.35 2019/04/23 07:45:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.35.2.1 2022/08/03 11:11:33 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd32.h"
@@ -163,6 +163,8 @@ stios2btios(struct sunos_termios *st, struct termios *bt)
{
netbsd32_u_long l, r;
+ memset(bt, 0, sizeof(*bt));
+
l = st->c_iflag;
r = ((l & 0x00000001) ? IGNBRK : 0);
r |= ((l & 0x00000002) ? BRKINT : 0);
@@ -284,6 +286,8 @@ btios2stios(struct termios *bt, struct sunos_termios *st)
netbsd32_u_long l, r;
int s;
+ memset(st, 0, sizeof(*st));
+
l = bt->c_iflag;
r = ((l & IGNBRK) ? 0x00000001 : 0);
r |= ((l & BRKINT) ? 0x00000002 : 0);
@@ -408,6 +412,8 @@ btios2stios(struct termios *bt, struct sunos_termios *st)
static void
stios2stio(struct sunos_termios *ts, struct sunos_termio *t)
{
+
+ memset(t, 0, sizeof(*t));
t->c_iflag = ts->c_iflag;
t->c_oflag = ts->c_oflag;
t->c_cflag = ts->c_cflag;
@@ -419,6 +425,8 @@ stios2stio(struct sunos_termios *ts, struct sunos_termio *t)
static void
stio2stios(struct sunos_termio *t, struct sunos_termios *ts)
{
+
+ memset(ts, 0, sizeof(*ts));
ts->c_iflag = t->c_iflag;
ts->c_oflag = t->c_oflag;
ts->c_cflag = t->c_cflag;
@@ -534,6 +542,7 @@ sunos32_sys_ioctl(struct lwp *l, const struct sunos32_sys_ioctl_args *uap,
if (error != 0)
return error;
+ memset(&ss, 0, sizeof(ss));
ss.ts_row = ws.ws_row;
ss.ts_col = ws.ws_col;
@@ -766,6 +775,8 @@ sunos32_sys_ioctl(struct lwp *l, const struct sunos32_sys_ioctl_args *uap,
if (error)
return error;
+ memset(&sunos_aui, 0, sizeof(sunos_aui));
+
sunos_aui.play = *(struct sunos_audio_prinfo *)&aui.play;
sunos_aui.record = *(struct sunos_audio_prinfo *)&aui.record;
@@ -962,6 +973,9 @@ static void sunos_to_bsd_flock(struct sunos_flock *, struct flock *);
static void
bsd_to_sunos_flock(struct flock *iflp, struct sunos_flock *oflp)
{
+
+ memset(oflp, 0, sizeof(*oflp));
+
switch (iflp->l_type) {
case F_RDLCK:
oflp->l_type = SUNOS_F_RDLCK;
@@ -988,6 +1002,9 @@ bsd_to_sunos_flock(struct flock *iflp, struct sunos_flock *oflp)
static void
sunos_to_bsd_flock(struct sunos_flock *iflp, struct flock *oflp)
{
+
+ memset(oflp, 0, sizeof(*oflp));
+
switch (iflp->l_type) {
case SUNOS_F_RDLCK:
oflp->l_type = F_RDLCK;