Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: wipe buffer.

After we are done with the tty buffer, zero it out.

Reported-by: aszlig <aszlig@nix.build>
Tested-by: Milan Broz <gmazyland@gmail.com>
Tested-by: Daniel Zatovic <daniel.zatovic@gmail.com>
Tested-by: aszlig <aszlig@nix.build>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Linus Torvalds and committed by
Greg Kroah-Hartman
c9a8e5fc 3bc3206e

+5 -1
+5 -1
drivers/tty/tty_buffer.c
··· 473 473 { 474 474 unsigned char *p = char_buf_ptr(head, head->read); 475 475 char *f = NULL; 476 + int n; 476 477 477 478 if (~head->flags & TTYB_NORMAL) 478 479 f = flag_buf_ptr(head, head->read); 479 480 480 - return port->client_ops->receive_buf(port, p, f, count); 481 + n = port->client_ops->receive_buf(port, p, f, count); 482 + if (n > 0) 483 + memset(p, 0, n); 484 + return n; 481 485 } 482 486 483 487 /**