linux/drivers/tty/vt
Nicolas Pitre a883b70d8e tty vt: fix character insertion overflow
Commit 81732c3b2f ("tty vt: Fix line garbage in virtual console on
command line edition") broke insert_char() in multiple ways.  Then
commit b1a925f44a ("tty vt: Fix a regression in command line edition")
partially fixed it.  However, the buffer being moved is still too large
and overflowing beyond the end of the current line, corrupting existing
characters on the next line.

Example test case:

echo -e "abc\nde\x1b[A\x1b[4h \x1b[4l\x1b[B"

Expected result:

ab c
de

Current result:

ab c
 e

Needless to say that this is very annoying when inserting words in the
middle of paragraphs with certain text editors.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Cc: Jean-François Moine <moinejf@free.fr>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-24 17:29:49 -08:00
..
.gitignore
consolemap.c tty: vt: Remove redundant null check before kfree. 2012-11-26 15:36:38 -08:00
cp437.uni
defkeymap.c_shipped
defkeymap.map
keyboard.c TTY: switch tty_schedule_flip 2013-01-15 22:43:15 -08:00
Makefile tty: vt/Makefile: set the variables to static 2013-01-15 21:52:24 -08:00
selection.c TTY: vt, fix paste_selection ldisc handling 2012-10-22 16:50:53 -07:00
vc_screen.c vt: push down the tty lock so we can see what is left to tackle 2012-03-08 11:10:27 -08:00
vt_ioctl.c drivers/tty/vt/vt_ioctl.c: Include <linux/suspend.h> for pm_set_vt_switch 2012-11-21 15:19:52 -08:00
vt.c tty vt: fix character insertion overflow 2013-02-24 17:29:49 -08:00