lkml.org 
[lkml]   [2011]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][rfc] xattr acl: Suspicious use of potentially null pointer.
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



\
 
 \ /
  Last update: 2011-01-07 00:51    [W:0.037 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site