linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] e2fsprogs: fix potential null ptr defef in check_for_modules()
Date: Fri, 6 Mar 2009 02:38:11 -0500	[thread overview]
Message-ID: <20090306073811.GB6514@mit.edu> (raw)
In-Reply-To: <49A46303.7070405@redhat.com>

On Tue, Feb 24, 2009 at 03:13:39PM -0600, Eric Sandeen wrote:
> The coverity scanner found this one.
> 
> If a line in modules.dep has a ":" but no "/" then:
> 
>                 if ((cp = strchr(buf, ':')) != NULL)
>                         *cp = 0;
>                 else
>                         continue;
>                 if ((cp = strrchr(buf, '/')) != NULL)
>                         cp++;
>                 /* XXX else cp is still null */
>                 i = strlen(cp);
> 
> ... we will deref a null pointer (cp).  This can be 
> demonstrated by putting a line like:
> 
> foo.ko:
> 
> into modules.dep.  The below change just says that if no "/" is
> found, treat the whole string as the module name.

Thanks, applied to the e2fsprogs git tree.

					- Ted

      parent reply	other threads:[~2009-03-06  7:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24 21:13 [PATCH] e2fsprogs: fix potential null ptr defef in check_for_modules() Eric Sandeen
2009-02-26 22:20 ` [PATCH] e2fsprogs: fix potential null ptr deref " Eric Sandeen
2009-03-06  7:38 ` Theodore Tso [this message]

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=20090306073811.GB6514@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).