summaryrefslogtreecommitdiff
path: root/sys/compat/sunos
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/sunos')
-rw-r--r--sys/compat/sunos/sunos_ioctl.c20
-rw-r--r--sys/compat/sunos/sunos_misc.c7
2 files changed, 23 insertions, 4 deletions
diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c
index d2f83c38bdd..c4deaf3bcc3 100644
--- a/sys/compat/sunos/sunos_ioctl.c
+++ b/sys/compat/sunos/sunos_ioctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos_ioctl.c,v 1.69 2019/04/23 07:45:06 msaitoh Exp $ */
+/* $NetBSD: sunos_ioctl.c,v 1.69.2.1 2022/08/03 11:11:31 martin Exp $ */
/*
* Copyright (c) 1993 Markus Wild.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.69 2019/04/23 07:45:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.69.2.1 2022/08/03 11:11:31 martin Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -127,6 +127,8 @@ stios2btios(struct sunos_termios *st, struct termios *bt)
{
u_long l, r;
+ memset(bt, 0, sizeof(*bt));
+
l = st->c_iflag;
r = ((l & 0x00000001) ? IGNBRK : 0);
r |= ((l & 0x00000002) ? BRKINT : 0);
@@ -248,6 +250,8 @@ btios2stios(struct termios *bt, struct sunos_termios *st)
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);
@@ -372,6 +376,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;
@@ -383,6 +389,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;
@@ -485,6 +493,7 @@ sunos_sys_ioctl(struct lwp *l, const struct sunos_sys_ioctl_args *uap,
if ((error = (*ctl)(fp, TIOCGWINSZ, &ws)) != 0)
break;
+ memset(&ss, 0, sizeof(ss));
ss.ts_row = ws.ws_row;
ss.ts_col = ws.ws_col;
@@ -726,6 +735,7 @@ sunos_sys_ioctl(struct lwp *l, const struct sunos_sys_ioctl_args *uap,
if (error)
break;
+ 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;
@@ -936,6 +946,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;
@@ -962,6 +975,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/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c
index 8437b5f2de8..93c4bb2b6fd 100644
--- a/sys/compat/sunos/sunos_misc.c
+++ b/sys/compat/sunos/sunos_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $ */
+/* $NetBSD: sunos_misc.c,v 1.173.2.1 2022/08/03 11:11:31 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.173.2.1 2022/08/03 11:11:31 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -305,6 +305,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];
}
@@ -312,6 +313,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;
@@ -431,6 +433,7 @@ again:
off += reclen;
continue;
}
+ memset(&idb, 0, sizeof(idb));
sunos_reclen = SUNOS_RECLEN(&idb, bdp->d_namlen);
if (reclen > len || resid < sunos_reclen) {
/* entry too big for buffer, so just stop */