All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: samuel.thibault@ens-lyon.org,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] braille_console: Read buffer overflow
Date: Tue, 11 Aug 2009 16:36:42 +0200	[thread overview]
Message-ID: <4A8181FA.2010009@gmail.com> (raw)

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)

             reply	other threads:[~2009-08-11 14:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 14:36 Roel Kluin [this message]
2009-08-11 14:41 ` [PATCH] braille_console: Read buffer overflow Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8181FA.2010009@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.