wipe out tty buffer contents after read, to avoid keeping possibly
sensitive information in memory longer than necessary (We could make this depend on ~ECHO or so, but this would be an API change and I don't think it is worth the effort.)
This commit is contained in:
parent
0a06aa4eeb
commit
8b720093a8
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tty_subr.c,v 1.33 2008/05/25 19:22:21 ad Exp $ */
|
||||
/* $NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Theo de Raadt
|
||||
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.33 2008/05/25 19:22:21 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -129,6 +129,7 @@ getc(struct clist *clp)
|
|||
c |= TTY_QUOTE;
|
||||
#endif
|
||||
}
|
||||
*clp->c_cf = 0; /* wipe out to avoid information disclosure */
|
||||
if (++clp->c_cf == clp->c_ce)
|
||||
clp->c_cf = clp->c_cs;
|
||||
if (--clp->c_cc == 0)
|
||||
|
|
Loading…
Reference in New Issue