mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
vt: fix unicode buffer corruption when deleting characters
commit 1581dafaf0d34bc9c428a794a22110d7046d186d upstream.
This is the same issue that was fixed for the VGA text buffer in commit
39cdb68c64d8 ("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 <[email protected]>
Fixes: 81732c3b2f ("tty vt: Fix line garbage in virtual console on command line edition")
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
741dee500f
commit
ff7342090c
1 changed files with 1 additions and 1 deletions
|
|
@ -405,7 +405,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
|
|||
char32_t *ln = uniscr->lines[vc->vc_y];
|
||||
unsigned int x = vc->vc_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 a new issue