* [PATCH] braille_console: Read buffer overflow
@ 2009-08-11 14:36 Roel Kluin
2009-08-11 14:41 ` Samuel Thibault
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-08-11 14:36 UTC (permalink / raw)
To: samuel.thibault, Andrew Morton, LKML
Prevent write to console_buf[-1]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
If console_newline is true and console_cursor equals WIDTH
c is written to console_buf[-1].
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index d672cfe..fb4075b 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -322,7 +322,8 @@ static int vt_notifier_call(struct notifier_block *blk,
(WIDTH-1) * sizeof(*console_buf));
else
console_cursor++;
- console_buf[console_cursor-1] = c;
+ if (console_cursor != 0)
+ console_buf[console_cursor-1] = c;
break;
}
if (console_show)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] braille_console: Read buffer overflow
2009-08-11 14:36 [PATCH] braille_console: Read buffer overflow Roel Kluin
@ 2009-08-11 14:41 ` Samuel Thibault
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2009-08-11 14:41 UTC (permalink / raw)
To: Roel Kluin; +Cc: Andrew Morton, LKML
Roel Kluin, le Tue 11 Aug 2009 16:36:42 +0200, a écrit :
> If console_newline is true and console_cursor equals WIDTH
Err, that can never happen since when console_newline is true,
console_cursor is reset to 0, then incremented to 1.
Samuel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-11 14:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 14:36 [PATCH] braille_console: Read buffer overflow Roel Kluin
2009-08-11 14:41 ` Samuel Thibault
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.