mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Collins <bcollins@debian.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] potential NULL deref in serial/core.c
Date: Wed, 23 Oct 2002 15:02:11 -0400	[thread overview]
Message-ID: <20021023190211.GG536@phunnypharm.org> (raw)

Not sure if it's supposed to be a BUG() for tty to be NULL, but it's
surely a bug to dereference it before checking for that.



--- drivers/serial/core.c~	2002-10-23 14:59:17.000000000 -0400
+++ drivers/serial/core.c	2002-10-23 14:59:42.000000000 -0400
@@ -472,10 +472,12 @@
 
 static void uart_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_info *info;
 
-	if (tty)
+	if (tty) {
+		info = tty->driver_data;
 		__uart_put_char(info->port, &info->xmit, ch);
+	}
 }
 
 static void uart_flush_chars(struct tty_struct *tty)

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo       - http://www.deqo.com/

             reply	other threads:[~2002-10-23 18:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-23 19:02 Ben Collins [this message]
2002-10-23 19:10 ` Ben Collins

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=20021023190211.GG536@phunnypharm.org \
    --to=bcollins@debian.org \
    --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

all inboxes | Powered by JetHome®