public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: dmitry.torokhov@gmail.com
Subject: [Patch] Overrun in drivers/input/joystick/db9.c
Date: Wed, 28 Jun 2006 00:16:14 +0200	[thread overview]
Message-ID: <1151446574.15289.7.camel@alice> (raw)

hi,

coverity spotted this overrun (#id 483), we assign 
db9_mode = &db9_modes[mode]; some lines before, so
if we use mode as index again we might get past the
array once mode is greater than DB9_MAX_PAD/2,
besides this this patch changes the code to what
the author possibly intended it to do.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-git11/drivers/input/joystick/db9.c.orig	2006-06-28 00:06:47.000000000 +0200
+++ linux-2.6.17-git11/drivers/input/joystick/db9.c	2006-06-28 00:08:32.000000000 +0200
@@ -584,7 +584,7 @@ static struct db9 __init *db9_probe(int 
 		goto err_out;
 	}
 
-	if (db9_mode[mode].bidirectional && !(pp->modes & PARPORT_MODE_TRISTATE)) {
+	if (db9_mode->bidirectional && !(pp->modes & PARPORT_MODE_TRISTATE)) {
 		printk(KERN_ERR "db9.c: specified parport is not bidirectional\n");
 		err = -EINVAL;
 		goto err_put_pp;



             reply	other threads:[~2006-06-27 22:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27 22:16 Eric Sesterhenn [this message]
2006-06-28  3:43 ` [Patch] Overrun in drivers/input/joystick/db9.c Dmitry Torokhov

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=1151446574.15289.7.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox