From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Jaroslav Kysela" <perex@suse.cz>
Subject: Re: [PATCH][isapnp] Fix a potential NULL pointer dereference in isapnp_read_tag()
Date: Wed, 4 Jul 2007 03:04:13 +0200 [thread overview]
Message-ID: <9a8748490707031804v51ca1c79kdf55150c47b01b3d@mail.gmail.com> (raw)
In-Reply-To: <20070703130318.9dbec3ac.akpm@linux-foundation.org>
On 03/07/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Sun, 1 Jul 2007 01:38:31 +0200
> Jesper Juhl <jesper.juhl@gmail.com> wrote:
>
> > The Coverity checker spotted (as bug #809) that we dereference 'type'
> > long before we actually test it against NULL in
> > drivers/pnp/isapnp/core.c::isapnp_read_tag() - both branches of the
> > 'if (tag & 0x80)' dereference type, and since this 'if' is before the test
> > against NULL and the return of -1, this will blow up is ever type is NULL.
> > This is easy to fix by simply moving the NULL test to the beginning of
> > the function.
> >
[snip]
>
> dood, look at the callers. NULL is not possible here.
>
You are right, there's absolutely no way that we could get a NULL
pointer there - that was sloppy of me :-(
I guess we should just get rid of the check completely. I'll cook up
a patch for that tomorrow.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2007-07-04 1:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-30 23:38 Jesper Juhl
2007-07-03 20:03 ` Andrew Morton
2007-07-04 1:04 ` Jesper Juhl [this message]
2007-07-04 22:59 ` [PATCH][isapnp] Remove pointless check of 'type' against 0 " Jesper Juhl
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=9a8748490707031804v51ca1c79kdf55150c47b01b3d@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@suse.cz \
/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®