From: Mikulas Patocka Date: Fri, 30 Jan 2009 20:27:14 +0000 (-0500) Subject: Fix memory corruption in console selection X-Git-Tag: v2.6.27.15~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29213e5505e77c76b1d528404f981a621297cfd1;p=pandora-kernel.git Fix memory corruption in console selection commit 878b8619f711280fd05845e21956434b5e588cc4 upstream. 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 Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed