mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
vt: fix unicode buffer corruption when deleting characters
commit1581dafaf0
upstream. This is the same issue that was fixed for the VGA text buffer in commit39cdb68c64
("vt: fix memory overlapping when deleting chars in the buffer"). The cure is also the same i.e. replace memcpy() with memmove() due to the overlaping buffers. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Fixes:81732c3b2f
("tty vt: Fix line garbage in virtual console on command line edition") Cc: stable <stable@kernel.org> Link: https://lore.kernel.org/r/sn184on2-3p0q-0qrq-0218-895349s4753o@syhkavp.arg Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
99cd2d491d
commit
994a1e583c
@ -398,7 +398,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
|
||||
char32_t *ln = uniscr->lines[vc->state.y];
|
||||
unsigned int x = vc->state.x, cols = vc->vc_cols;
|
||||
|
||||
memcpy(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
|
||||
memmove(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
|
||||
memset32(&ln[cols - nr], ' ', nr);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user