From: Dan Carpenter <error27@gmail.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH][rfc] xattr acl: Suspicious use of potentially null pointer.
Date: Fri, 7 Jan 2011 02:47:57 +0300 [thread overview]
Message-ID: <20110106234750.GB1761@bicker> (raw)
In-Reply-To: <alpine.LNX.2.00.1101062247420.13988@swampdragon.chaosbits.net>
On Thu, Jan 06, 2011 at 10:52:22PM +0100, Jesper Juhl wrote:
>
> In posix_acl_from_xattr() we have this at the head of the function:
>
> posix_acl_xattr_header *header = (posix_acl_xattr_header *)value;
> posix_acl_xattr_entry *entry = (posix_acl_xattr_entry *)(header+1), *end;
>
> Since 'value' is passed in by the caller and may be NULL, the second line
> looks suspicious to me - taking a potentially NULL pointer (at least
> btrfs will pass something allocated with kmalloc() which may be NULL),
> adding one to it and casting it does not seem like it would always be such
> a hot idea.
The original code is fine.
regards,
dan carpenter
prev parent reply other threads:[~2011-01-06 23:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 21:52 [PATCH][rfc] xattr acl: Suspicious use of potentially null pointer Jesper Juhl
2011-01-06 23:47 ` Dan Carpenter [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=20110106234750.GB1761@bicker \
--to=error27@gmail.com \
--cc=jj@chaosbits.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.