diff options
author | 2014-05-30 02:12:04 +0000 | |
---|---|---|
committer | 2014-05-30 02:12:04 +0000 | |
commit | aed32d7190d2af2e585e0baf823d0511ccf965be (patch) | |
tree | 7ad4aea1250fb85b35784fa34bc22763a96004d5 | |
parent | I do not have time to describe how bad the realloc() uses in here, now (diff) | |
download | wireguard-openbsd-aed32d7190d2af2e585e0baf823d0511ccf965be.tar.xz wireguard-openbsd-aed32d7190d2af2e585e0baf823d0511ccf965be.zip |
explicit_bzero for clearing stack variables.
-rw-r--r-- | sys/kern/tty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 9afcad6eb8b..75df0023733 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.106 2014/05/25 18:57:07 guenther Exp $ */ +/* $OpenBSD: tty.c,v 1.107 2014/05/30 02:12:04 tedu Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -180,7 +180,7 @@ ttyopen(dev_t device, struct tty *tp, struct proc *p) tp->t_dev = device; if (!ISSET(tp->t_state, TS_ISOPEN)) { SET(tp->t_state, TS_ISOPEN); - bzero(&tp->t_winsize, sizeof(tp->t_winsize)); + memset(&tp->t_winsize, 0, sizeof(tp->t_winsize)); tp->t_column = 0; } CLR(tp->t_state, TS_WOPEN); @@ -1851,7 +1851,7 @@ out: uio->uio_resid += cc; done: if (obufcc) - bzero(obuf, obufcc); + explicit_bzero(obuf, obufcc); return (error); overfull: @@ -1878,7 +1878,7 @@ ovhiwat: splx(s); uio->uio_resid += cc; if (obufcc) - bzero(obuf, obufcc); + explicit_bzero(obuf, obufcc); return (uio->uio_resid == cnt ? EWOULDBLOCK : 0); } SET(tp->t_state, TS_ASLEEP); |