summaryrefslogtreecommitdiff
path: root/sys/compat/sunos32
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/sunos32')
-rw-r--r--sys/compat/sunos32/sunos32_ioctl.c21
-rw-r--r--sys/compat/sunos32/sunos32_misc.c8
2 files changed, 25 insertions, 4 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;
diff --git a/sys/compat/sunos32/sunos32_misc.c b/sys/compat/sunos32/sunos32_misc.c
index 5522d970700..c2ef8d9b853 100644
--- a/sys/compat/sunos32/sunos32_misc.c
+++ b/sys/compat/sunos32/sunos32_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_misc.c,v 1.79 2018/09/03 16:29:30 riastradh Exp $ */
+/* $NetBSD: sunos32_misc.c,v 1.79.4.1 2022/08/03 11:11:33 martin Exp $ */
/* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
/*
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.79 2018/09/03 16:29:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.79.4.1 2022/08/03 11:11:33 martin Exp $");
#define COMPAT_SUNOS 1
@@ -161,6 +161,7 @@ sunos32_sigvec_from_sigaction(
{
/*XXX*/ extern void compat_43_sigset_to_sigmask(const sigset_t *, int *);
+ memset(sv, 0, sizeof(*sv));
NETBSD32PTR32(sv->sv_handler, sa->sa_handler);
compat_43_sigset_to_sigmask(&sa->sa_mask, &sv->sv_mask);
sv->sv_flags = sa->sa_flags ^ SA_RESTART;
@@ -541,6 +542,7 @@ void sunos_to_native_sigset(const int, sigset_t *);
inline void
native_to_sunos_sigset(const sigset_t *ss, int *mask)
{
+
*mask = ss->__bits[0];
}
@@ -548,6 +550,7 @@ inline void
sunos_to_native_sigset(const int mask, sigset_t *ss)
{
+ memset(ss, 0, sizeof(*ss));
ss->__bits[0] = mask;
ss->__bits[1] = 0;
ss->__bits[2] = 0;
@@ -676,6 +679,7 @@ again:
off += reclen;
continue;
}
+ memset(&idb, 0, sizeof(idb));
sunos_reclen = SUNOS32_RECLEN(&idb, bdp->d_namlen);
if (reclen > len || resid < sunos_reclen) {
/* entry too big for buffer, so just stop */