Mikulas Patocka 878b8619f7 Fix memory corruption in console selection
Fix an off-by-two memory error in console selection.

The loop below goes from sel_start to sel_end (inclusive), so it writes
one more character.  This one more character was added to the allocated
size (+1), but it was not multiplied by an UTF-8 multiplier.

This patch fixes a memory corruption when UTF-8 console is used and the
user selects a few characters, all of them 3-byte in UTF-8 (for example
a frame line).

When memory redzones are enabled, a redzone corruption is reported.
When they are not enabled, trashing of random memory occurs.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-31 15:51:31 -08:00
..
2009-01-02 10:19:42 -08:00
2009-01-02 10:19:38 -08:00
2009-01-09 03:39:43 -05:00
2008-06-20 14:05:55 -06:00
2008-12-13 11:25:49 -08:00
2008-10-20 08:52:41 -07:00
2008-12-13 09:12:07 +00:00
2008-07-20 17:12:36 -07:00
2008-06-20 14:05:57 -06:00
2008-12-03 21:04:09 +11:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:28:32 -08:00
2008-06-20 14:05:48 -06:00
2008-02-07 08:42:25 -08:00
2008-04-30 08:29:43 -07:00
2008-07-24 10:47:14 -07:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:19:40 -08:00
2007-02-12 09:48:30 -08:00
2009-01-12 16:37:00 -08:00
2009-01-02 10:19:40 -08:00
2008-07-20 17:12:38 -07:00
2009-01-08 16:44:03 -07:00
2006-01-12 09:09:00 -08:00
2009-01-02 10:19:40 -08:00
2008-11-11 21:14:11 -05:00
2008-07-20 17:12:38 -07:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:19:40 -08:00
2009-01-15 16:39:37 -08:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:19:40 -08:00
2008-06-20 14:05:51 -06:00
2008-04-30 23:15:34 +02:00
2008-12-09 20:32:06 +11:00
2009-01-02 10:19:38 -08:00
2008-10-16 16:52:05 +02:00
2009-01-02 10:19:40 -08:00
2009-01-08 08:31:15 -08:00